Handbook
Glossary
sleep-until ( n/f -- )
Vocabulary
threads
Inputs
n/f
a non-negative integer or
f
Outputs
None
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
;
USING:
calendar
threads
;
M:
timestamp
sleep-until
now
time-
sleep
;