block-unless-pred ( ... mailbox timeout pred: ( ... message -- ... ? ) -- ... )


Vocabulary
concurrency.mailboxes

Inputs
mailboxa mailbox
timeouta duration or f
preda 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


:: 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