suspend ( state -- obj )
Factor handbook > The language > Co-operative threads > Yielding and suspending threads

Prev:interrupt ( thread -- )
Next:resume ( thread -- )


Vocabulary
threads

Inputs and outputs
statea string
objan object


Word description
Suspends the current thread. Control yields to the next runnable thread and the current thread does not execute again until it is resumed, and so the caller of this word must arrange for another thread to later resume the suspended thread with a call to resume or resume-with.

The state string is for debugging purposes; see Listing threads.

Definition