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
concurrency.conditions
dlists
kernel
;
IN:
concurrency.mailboxes
::
block-unless-pred
( ... mailbox timeout pred: ( ... message -- ... ? ) -- ... )
timeout
>deadline
:>
deadline mailbox
data>>
pred
dlist-any?
[
mailbox deadline
wait-for-mailbox
mailbox deadline pred
block-unless-pred
]
unless
;
inline
recursive