Handbook
Glossary
block-unless-pred ( ... mailbox timeout pred: ( ... message -- ... ? ) -- ... )
Vocabulary
concurrency
.
mailboxes
Inputs
mailbox
a
mailbox
timeout
a
duration
or
f
pred
a
quotation
with stack effect
( ... message -- ... ? )
Outputs
None
Word description
Block the thread if there are no items in the mailbox that return true when the predicate is called with the item on the stack.
Definition
USING:
accessors
dlists
kernel
;
IN:
concurrency.mailboxes
::
block-unless-pred
( ... mailbox timeout pred: ( ... message -- ... ? ) -- ... )
mailbox
data>>
pred
dlist-any?
[
mailbox timeout
wait-for-mailbox
mailbox timeout pred
block-unless-pred
]
unless
;
inline
recursive