referrerpolicy=no-referrer-when-downgrade

Module thread

Source
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§

WaitOutcome
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.