Crate concurrency_traits

Source
Expand description

Traits for concurrent primitives.

Modules§

mutex
Generic Mutex traits and implementations.
queue
Generic implementations for queues.
rw_lock
Traits for RwLocks
semaphore
Traits and implementations for semaphores.
stack
Traits for a FIFO stack.

Structs§

StdThreadFunctions
Std implementations for TimeFunctions, [ThreadFunctions], [TryThreadSpawner], and [ThreadParker`].

Traits§

ConcurrentSystem
A full concurrent system with all functions accessible by reference. This Trait should be implemented where possible.
JoinableHandle
A handle to a spawned thread that can be joined infallibly. Auto-implemented with TryJoinableHandle where possible.
ResultThreadSpawner
Named version of ThreadSpawner where the handle is a TryJoinableHandle. Auto implemented.
ThreadFunctions
Functions to allow the current thread to interact in ways a thread might need to.
ThreadHandle
A handle to a spawned thread. Analog for std::thread::JoinHandle.
ThreadParker
Functions to allow parking functionality for threads.
ThreadSpawner
Same as a TryThreadSpawner with an Infallible TryThreadSpawner::SpawnError. This is auto-implemented with TryThreadSpawner when possible. If a result is needed from the launched thread look to ResultThreadSpawner.
ThreadTimeoutParker
Functions to allow parking functionality with timeout for threads.
TimeFunctions
Functions to interact with system time.
TryJoinableHandle
A handle to a spawned thread that can be joined, blocking the current thread until the target is finished. Analog for std::thread::JoinHandle. If infallibility is needed look to JoinableHandle.
TryResultThreadSpawner
Named version of TryThreadSpawner where the handle is a TryJoinableHandle. Auto implemented.
TryThreadSpawner
Functions to spawn new threads. If infallibility is required look to ThreadSpawner. If a result is needed from the launched thread look to TryResultThreadSpawner or ResultThreadSpawner. O is the result of the thread function.