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
(cherry picked from commit 76aefcb508)
This commit is contained in:
Matthew Flatt 2014-07-17 07:21:17 +01:00 committed by Ryan Culpepper
parent f5b73656a0
commit 1ab2f2643e

View File

@ -5170,7 +5170,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;