guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-123-gecba0


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-123-gecba00a
Date: Thu, 24 Mar 2011 19:20:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=ecba00af6501e082b86c8f2f7730081c733509d7

The branch, stable-2.0 has been updated
       via  ecba00af6501e082b86c8f2f7730081c733509d7 (commit)
      from  ad301b6d58c2ca054ebe1fdfaf7357e61311a977 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ecba00af6501e082b86c8f2f7730081c733509d7
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 24 20:20:14 2011 +0100

    with-continuation-barrier carps, calls exit(3) _after_ unwinding
    
    * libguile/continuations.c (scm_handler, c_handler)
      (scm_c_with_continuation_barrier, scm_with_continuation_barrier): Call
      scm_handle_by_message_noexit in the post-unwind handler, so that
      dynwinds
    
    * test-suite/tests/continuations.test ("continuations"): Add a test.

-----------------------------------------------------------------------

Summary of changes:
 libguile/continuations.c            |   16 +++++++++++++---
 test-suite/tests/continuations.test |   13 ++++++++++++-
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/libguile/continuations.c b/libguile/continuations.c
index dc6850e..28b6236 100644
--- a/libguile/continuations.c
+++ b/libguile/continuations.c
@@ -477,7 +477,13 @@ c_body (void *d)
 static SCM
 c_handler (void *d, SCM tag, SCM args)
 {
-  struct c_data *data = (struct c_data *)d;
+  struct c_data *data;
+
+  /* Print a message.  Note that if TAG is `quit', this will exit() the
+     process.  */
+  scm_handle_by_message_noexit (NULL, tag, args);
+
+  data = (struct c_data *)d;
   data->result = NULL;
   return SCM_UNSPECIFIED;
 }
@@ -490,7 +496,7 @@ scm_c_with_continuation_barrier (void *(*func) (void *), 
void *data)
   c_data.data = data;
   scm_i_with_continuation_barrier (c_body, &c_data,
                                   c_handler, &c_data,
-                                  scm_handle_by_message_noexit, NULL);
+                                  NULL, NULL);
   return c_data.result;
 }
 
@@ -508,6 +514,10 @@ scm_body (void *d)
 static SCM
 scm_handler (void *d, SCM tag, SCM args)
 {
+  /* Print a message.  Note that if TAG is `quit', this will exit() the
+     process.  */
+  scm_handle_by_message_noexit (NULL, tag, args);
+
   return SCM_BOOL_F;
 }
 
@@ -529,7 +539,7 @@ SCM_DEFINE (scm_with_continuation_barrier, 
"with-continuation-barrier", 1,0,0,
   scm_data.proc = proc;
   return scm_i_with_continuation_barrier (scm_body, &scm_data,
                                          scm_handler, &scm_data,
-                                         scm_handle_by_message_noexit, NULL);
+                                         NULL, NULL);
 }
 #undef FUNC_NAME
 
diff --git a/test-suite/tests/continuations.test 
b/test-suite/tests/continuations.test
index f6db40e..a436b90 100644
--- a/test-suite/tests/continuations.test
+++ b/test-suite/tests/continuations.test
@@ -1,7 +1,7 @@
 ;;;;                                                          -*- scheme -*-
 ;;;; continuations.test --- test suite for continutations
 ;;;;
-;;;; Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
+;;;; Copyright (C) 2003, 2006, 2009, 2011 Free Software Foundation, Inc.
 ;;;; 
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -80,6 +80,17 @@
                               (error "Catch me if you can!")))))))))
       handled))
 
+  (pass-if "exit unwinds dynwinds inside a continuation barrier"
+    (let ((s (with-error-to-string
+              (lambda ()
+                (with-continuation-barrier
+                 (lambda ()
+                   (dynamic-wind 
+                     (lambda () #f)
+                     (lambda () (exit 1))
+                     (lambda () (throw 'abcde)))))))))
+      (and (string-contains s "abcde") #t)))
+
   (with-debugging-evaluator
 
     (pass-if "make a stack from a continuation"


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]