X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fthread.c;h=eb8f2414cab6213a764724aa578d30db65fd5cab;hb=2675adcb29d689ee6d270f52658af17f2deeaf77;hp=ebdb2e464f5f69d743bf03d408531d42b1412925;hpb=224466fab9dc4e8b3faf13a121f827f198811bf6;p=sbcl.git diff --git a/src/runtime/thread.c b/src/runtime/thread.c index ebdb2e4..eb8f241 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -270,7 +270,7 @@ void block_sigcont(void) */ sigset_t newset; sigemptyset(&newset); - sigaddset(&newset,SIGCONT); + sigaddset(&newset,SIG_DEQUEUE); sigprocmask(SIG_BLOCK, &newset, 0); } @@ -282,7 +282,7 @@ void unblock_sigcont_and_sleep(void) { sigset_t set; sigemptyset(&set); - sigaddset(&set,SIGCONT); + sigaddset(&set,SIG_DEQUEUE); do { errno=0; sigwaitinfo(&set,0); @@ -298,6 +298,14 @@ int interrupt_thread(pid_t pid, lispobj function) return sigqueue(pid, SIG_INTERRUPT_THREAD, sigval); } +/* stopping the world is a two-stage process. From this thread we signal + * all the others with SIG_STOP_FOR_GC. The handler for this thread does + * the usual pseudo-atomic checks (we don't want to stop a thread while + * it's in the middle of allocation) then kills _itself_ with SIGSTOP. + * At any given time, countdown_to_gc should reflect the number of threads + * signalled but which haven't yet come to rest + */ + void gc_stop_the_world() { /* stop all other threads by sending them SIG_STOP_FOR_GC */