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 -- ... ? ) -- ... )
timeout >deadline :> deadline mailbox data>> pred dlist-any?
[
mailbox deadline wait-for-mailbox
mailbox deadline pred block-unless-pred
] unless ; inline recursive