Module functions
Free functions.
Structs
-
PanicGuard
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
Uses
park_timeout. - sleep Puts the current thread to sleep for at least the specified amount of time.
-
sleep_ms
Uses
sleep. - sleep_until Puts the current thread to sleep until the specified deadline has passed.
-
spawn
Spawns a new thread, returning a
JoinHandlefor it. - yield_now Cooperatively gives up a timeslice to the OS scheduler.