Expand description
Functionality related to threads spawned by the workers.
The motivation for this module is to coordinate worker threads without using async Rust.
Enums§
- Wait
Outcome - Contains the outcome of waiting on threads, or
Pending
if none are ready.
Functions§
- get_
condvar - Gets a condvar initialized to
Pending
. - spawn_
worker_ thread - Runs a worker thread. Will run the requested function, and afterwards notify the threads waiting on the condvar. Catches panics during execution and resumes the panics after triggering the condvar, so that the waiting thread is notified on panics.
- spawn_
worker_ thread_ with_ stack_ size - Runs a worker thread with the given stack size. See
spawn_worker_thread
. - wait_
for_ threads - Block the thread while it waits on the condvar.
- wait_
for_ threads_ with_ timeout - Block the thread while it waits on the condvar or on a timeout. If the timeout is hit,
returns
None
.
Type Aliases§
- Cond
- Helper type.