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.
This commit is contained in:
Alex Shinn 2011-12-25 17:14:01 +09:00
parent 52a3f55721
commit 904ae5743e

View file

@ -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); runner = sexp_make_thread(ctx, self, 2, sexp_cdr(tmp), SEXP_FALSE);
sexp_global(ctx, SEXP_G_THREADS_SIGNAL_RUNNER) = runner; sexp_global(ctx, SEXP_G_THREADS_SIGNAL_RUNNER) = runner;
sexp_thread_start(ctx, self, 1, 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 */ } else if (sexp_context_waitp(runner)) { /* wake it if it's sleeping */