fix sleep timeout in scheduler

In the case that the current time equals exactly the timeout of
a `sync/timeout`, the Racket process could get stuck (using no CPU)
instead of continuing as it should.

How did we not find this before? Why am I suddenly able to replicate
the problem (i.e., hitting exactly the target timeout in the secheduler
at the millisecond granularity)?

Merge to v6.1
This commit is contained in:
Matthew Flatt 2014-07-17 07:21:17 +01:00
parent d4b97dcca3
commit 76aefcb508

View File

@ -5186,7 +5186,7 @@ int scheme_block_until(Scheme_Ready_Fun _f, Scheme_Needs_Wakeup_Fun fdf,
if (sleep_end) {
delay = (float)(sleep_end - scheme_get_inexact_milliseconds());
delay /= 1000.0;
if (delay < 0)
if (delay <= 0)
delay = (float)0.00001;
} else
delay = 0.0;