Expand description
The Ordered Mutex has its mechanism of locking order when you have concurrent access to data. It will work well when you needed step by step data locking like sending UDP packages in a specific order.
Structsยง
- Ordered
Mutex - The Ordered Mutex has its mechanism of locking order when you have concurrent access to data. It will work well when you needed step by step data locking like sending UDP packages in a specific order.
- Ordered
Mutex Guard - The Simple OrderedMutex Guard
As long as you have this guard, you have exclusive access to the underlying
T
. The guard internally borrows the OrderedMutex, so the mutex will not be dropped while a guard exists. The lock is automatically released and waked the next locker whenever the guard is dropped, at which point lock will succeed yet again. - Ordered
Mutex Guard Future - Ordered
Mutex Owned Guard - An owned handle to a held OrderedMutex.
This guard is only available from a OrderedMutex that is wrapped in an
Arc
. It is identical toOrderedMutexGuard
, except that rather than borrowing theOrderedMutex
, it clones theArc
, incrementing the reference count. This means that unlikeOrderedMutexGuard
, it will have the'static
lifetime. As long as you have this guard, you have exclusive access to the underlyingT
. The guard internally keeps a reference-couned pointer to the originalOrderedMutex
, so even if the lock goes away, the guard remains valid. The lock is automatically released and waked the next locker whenever the guard is dropped, at which point lock will succeed yet again. - Ordered
Mutex Owned Guard Future