Handbook
Glossary
mailbox-put ( obj mailbox -- )
Mailboxes
Prev:
mailbox-get-all-timeout ( mailbox timeout -- seq )
Next:
mailbox-empty? ( mailbox -- bool )
Vocabulary
concurrency
.
mailboxes
Inputs
obj
an
object
mailbox
a
mailbox
Outputs
None
Word description
Put the object into the mailbox. Any threads that have a blocking get on the mailbox are resumed. Only one of those threads will successfully get the object, the rest will immediately block waiting for the next item in the mailbox.
Definition
IN:
concurrency.mailboxes
GENERIC:
mailbox-put
( obj mailbox -- )
Methods
USING:
accessors
concurrency.conditions
concurrency.mailboxes
deques
kernel
threads
;
M:
mailbox
mailbox-put
[
data>>
push-front
]
[
threads>>
notify-all
]
bi
yield
;