From 904ae5743e30ed2b46c279e0654815c3ba525b67 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 25 Dec 2011 17:14:01 +0900 Subject: [PATCH] Updating the front of the thread list when a signal is caught. This fixes the delay caused when a signal is caught while only a single other thread is running. --- lib/srfi/18/threads.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/srfi/18/threads.c b/lib/srfi/18/threads.c index 460c49f5..8dc97384 100644 --- a/lib/srfi/18/threads.c +++ b/lib/srfi/18/threads.c @@ -394,6 +394,8 @@ sexp sexp_scheduler (sexp ctx, sexp self, sexp_sint_t n, sexp root_thread) { runner = sexp_make_thread(ctx, self, 2, sexp_cdr(tmp), SEXP_FALSE); sexp_global(ctx, SEXP_G_THREADS_SIGNAL_RUNNER) = runner; sexp_thread_start(ctx, self, 1, runner); + if (!sexp_pairp(front)) + front = sexp_global(ctx, SEXP_G_THREADS_FRONT); } } } else if (sexp_context_waitp(runner)) { /* wake it if it's sleeping */