From 51c12f61150970812665df8d36241c1981831c00 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 13 Aug 2012 13:49:48 +0000 Subject: [PATCH] If the only available thread is paused and we need to schedule it, remove it from the paused list. Fixes issue #138 - otherwise the thread can be revived in the repl after we sleep. --- 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 866a782f..4ac2aa1f 100644 --- a/lib/srfi/18/threads.c +++ b/lib/srfi/18/threads.c @@ -547,6 +547,8 @@ sexp sexp_scheduler (sexp ctx, sexp self, sexp_sint_t n, sexp root_thread) { sexp_global(ctx, SEXP_G_THREADS_PAUSED) = sexp_cdr(paused); if (sexp_not(sexp_memq(ctx, tmp, paused))) sexp_insert_timed(ctx, tmp, tmp); + } else { + sexp_delete_list(ctx, SEXP_G_THREADS_PAUSED, res); } usecs = 0; if ((sexp_context_timeval(res).tv_sec == 0)