Expand description
Free functions.
Re-exportsΒ§
use super::builder::Builder;πuse super::current::current;πuse super::join_handle::JoinHandle;πuse crate::mem::forget;πuse crate::num::NonZero;πuse crate::sys::thread as imp;πuse crate::time::Duration;πuse crate::time::Instant;πuse crate::io;πuse crate::panicking;π
StructsΒ§
- Panic
Guard π - Used to ensure that
parkandpark_timeoutdo not unwind, as that can cause undefined behavior if not handled correctly (see #102398 for context).
FunctionsΒ§
- available_
parallelism - Returns an estimate of the default amount of parallelism a program should use.
- panicking
- Determines whether the current thread is panicking.
- park
- Blocks unless or until the current threadβs token is made available.
- park_
timeout - Blocks unless or until the current threadβs token is made available or the specified duration has been reached (may wake spuriously).
- park_
timeout_ ms Deprecated - Uses
park_timeout. - sleep
- Puts the current thread to sleep for at least the specified amount of time.
- sleep_
ms Deprecated - Uses
sleep. - spawn
- Spawns a new thread, returning a
JoinHandlefor it. - yield_
now - Cooperatively gives up a timeslice to the OS scheduler.
- sleep_
until Experimental - Puts the current thread to sleep until the specified deadline has passed.