A positive number
A function designator.
Arguments passed to function .
seconds, but wakes up if another process did something to wake up the current process (normally this is process-poke, but it can also be process-interrupt, process-stop, process-unstop or process-kill).
is passed just before going to sleep,
, and if this returns a true value
returns it immediately.
are not used otherwise. If another process calls process-poke on the current process after setting something that causes function to return true, it guarantees that
will return immediately without sleeping.
current-process-pauseis applied only once, and within the dynamic scope of
current-process-pause. It therefore does not have any of the restrictions that the wait-function in process-wait has.
is passed to
, because another process may call process-poke after
was called but before it went to sleep. If
was not passed,
would unnecessariliy sleep the whole 60 seconds in this case. The same thing could be implemented by process-wait-with-timeout, but the implementation above does not require a wait function that can run in another dynamic scope repeatedly at arbitrary times, and it uses much less system resources. It is also easier to debug.