mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 05:06:37 +02:00
When write-char fails and no scheduler is loaded, wait 5ms to avoid busy looping.
This commit is contained in:
parent
af71abc817
commit
e464f30ba2
1 changed files with 2 additions and 0 deletions
2
vm.c
2
vm.c
|
@ -1941,6 +1941,8 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
|
|||
if (sexp_port_stream(_ARG2)) clearerr(sexp_port_stream(_ARG2));
|
||||
if (sexp_applicablep(sexp_global(ctx, SEXP_G_THREADS_BLOCKER)))
|
||||
sexp_apply1(ctx, sexp_global(ctx, SEXP_G_THREADS_BLOCKER), _ARG2);
|
||||
else /* no scheduler but output full, wait 5ms */
|
||||
usleep(5*1000);
|
||||
fuel = 0;
|
||||
ip--; /* try again */
|
||||
goto loop;
|
||||
|
|
Loading…
Add table
Reference in a new issue