[plt-scheme] waking a sleeping thread?
At Wed, 18 Mar 2009 13:28:04 -0700, YC wrote:
> is there a way to wake a sleeping thread? I thought I can do it with
> thread-resume, but apparently a sleeping thread isn't suspended.
You mean a thread that is in a call to `sleep', right?
You could send the thread a break signal, but that raises an exception.
There's no way to just have the `sleep' return immediately.
Instead of calling `sleep, you could make the thread call
`sync/timeout' with a timeout (for sleeping) plus some other value that
you use as a wake-up event.