Expand description
Atomic counting semaphore that can help you control access to a common resource by multiple processes in a concurrent system.
§Features
- Effectively lock-free* semantics
- Provides RAII-style acquire/release API
- Implements
Send
,Sync
andClone
* lock-free when not using the shutdown
API
Structs§
- Semaphore
- Counting semaphore to control concurrent access to a common resource.
- Semaphore
Guard - RAII guard used to release access to the semaphore automatically when it falls out of scope.
- Shutdown
Handle - Handle representing the shutdown process of a semaphore, allowing for extraction of the underlying resource.
Enums§
- TryAccess
Error - Error indicating a failure to acquire access to the resource behind the semaphore.
Type Aliases§
- TryAccess
Result - Result returned from
Semaphore::try_access
.