sleep-until ( n/f -- )


Vocabulary
threads

Inputs and outputs
n/fa non-negative integer or f


Word description
Suspends the current thread until the given nanosecond count, returned by nano-count, is reached, or indefinitely if a value of f is passed in.

Other threads may interrupt the sleep by calling interrupt.

Definition
IN: threads

GENERIC: sleep-until ( n/f -- )


Methods
USING: kernel threads ;

M: f sleep-until drop "standby" suspend drop ;


USING: kernel math threads threads.private ;

M: integer sleep-until
[ self ] dip schedule-sleep "sleep" suspend drop ;