<thread> ( quot name -- thread )
Factor handbook » The language » Co-operative threads » Starting and stopping threads

Prev:spawn-server ( quot name -- thread )
Next:(spawn) ( thread -- )


Vocabulary
threads

Inputs
quota quotation
namea string


Outputs
threada thread


Word description
Low-level thread constructor. The thread runs the quotation when spawned.

The name is used to identify the thread for debugging purposes; see Listing threads.

Notes
In most cases, user code should call spawn instead, however for control over the error handler quotation, threads can be created with <thread> then passed to (spawn).

Definition

: <thread> ( quot name -- thread ) \ thread new-thread ;