Handbook
Glossary
block-if-empty ( mailbox timeout -- mailbox )
Vocabulary
concurrency
.
mailboxes
Inputs
mailbox
a
mailbox
timeout
a
duration
or
f
Outputs
mailbox
a
mailbox
Word description
Block the thread for
timeout
if the mailbox is empty.
Definition
USING:
kernel
;
IN:
concurrency.mailboxes
:
block-if-empty
( mailbox timeout -- mailbox )
over
mailbox-empty?
[
2dup
wait-for-mailbox
block-if-empty
]
[
drop
]
if
;
inline
recursive