summaryrefslogtreecommitdiff
path: root/libguile/threads.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-01-08 13:02:56 +0100
committerAndy Wingo <wingo@pobox.com>2017-01-08 13:02:56 +0100
commita000e5c38d50883c517214776dda36f4e478ebad (patch)
treee0a750ec63ad2956c4c731e2b46b9db684730179 /libguile/threads.c
parent78239acff60e74fa02ffbccc37ec710ad92be064 (diff)
downloadguile-a000e5c38d50883c517214776dda36f4e478ebad.tar.gz
Enable interrupts only when running thread body
* libguile/threads.c (really_launch): Start threads with asyncs blocked. * module/ice-9/threads.scm (call-with-new-thread): Unblock asyncs once we have the bookkeeping sorted out. Don't use with-continuation-barrier; it's not needed. Print nice thread backtraces.
Diffstat (limited to 'libguile/threads.c')
-rw-r--r--libguile/threads.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libguile/threads.c b/libguile/threads.c
index b46a71b42..64bef8c89 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -732,6 +732,9 @@ typedef struct {
static void *
really_launch (void *d)
{
+ scm_i_thread *t = SCM_I_CURRENT_THREAD;
+ /* The thread starts with asyncs blocked. */
+ t->block_asyncs++;
SCM_I_CURRENT_THREAD->result = scm_call_0 (((launch_data *)d)->thunk);
return 0;
}