Skip to main content

Module sync

Module sync 

Source
Expand description

Locks for crate::thread’s cooperative threads, shaped like std::sync: Mutex, Condvar, Semaphore. A wait lets the other threads run; time is the frame’s. Without the threaded loop there is only the calling thread: locks always succeed, waits with a timeout time out at once, waits without one trap (nothing else could ever wake them).

Structs§

Condvar
A condition variable: wait for a change another thread makes under a Mutex.
Mutex
A mutual exclusion lock (not recursive: locking it again from the same thread is a deadlock).
MutexGuard
Holds a Mutex; unlocks it when dropped.
Semaphore
A counting semaphore.
WaitTimeoutResult
Whether a timed wait returned because the time ran out.