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.
This commit is contained in:
Alex Shinn 2012-08-13 13:49:48 +00:00
parent 736ff434e6
commit 51c12f6115

View file

@ -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)