Expand description
Standard-compatible threads and borrowed scopes for the selected backend.
In simulation, panicking() reads the shared OS thread’s unwind flag, not a logical task’s
state. It can therefore report another task’s panic while an unwinding destructor yields.
Re-exports§
pub use crate::sync::time::sleep;
Structs§
- Builder
- Thread factory, which can be used in order to configure the properties of a new thread.
- Join
Handle - An owned permission to join on a thread (block on its termination).
- Scope
- A scope to spawn scoped threads in.
- Scoped
Join Handle - An owned permission to join on a scoped thread (block on its termination).
- Thread
- A handle to a thread.
- Thread
Id - A unique identifier for a running thread.
Functions§
- available_
parallelism - Returns available native parallelism, or one logical execution thread in simulation.
- current
- Gets a handle to the thread that invokes it.
- panicking
- Determines whether the current thread is panicking.
- park
- Blocks unless or until the current thread’s token is made available.
- scope
- Creates a scope for spawning scoped threads.
- spawn
- Spawns a new thread, returning a
JoinHandlefor it. - yield_
now - Cooperatively gives up a timeslice to the OS scheduler.