Module thread

Source
Expand description

Native threads.

Structs§

Buildermultitask
Thread factory, which can be used in order to configure the properties of a new thread.
JoinHandlemultitask
An owned permission to join on a thread (block on its termination).
Threadmultitask
A handle to a thread.
ThreadIdmultitask
A unique identifier for a running thread.

Functions§

currentmultitask
Gets a handle to the thread that invokes it.
exit
Exits the current thread.
sleep
Current thread is going to sleep for the given duration.
sleep_until
Current thread is going to sleep, it will be woken up at the given deadline.
spawnmultitask
Spawns a new thread, returning a JoinHandle for it.
yield_now
Current thread gives up the CPU time voluntarily, and switches to another ready thread.