1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 17:20:29 +02:00

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.
This commit is contained in:
Andy Wingo 2011-03-24 20:20:14 +01:00
parent ad301b6d58
commit ecba00af65
2 changed files with 25 additions and 4 deletions

View file

@ -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