Non-recursive shared mutex.
More...
#include <StormByte/safe/shared_mutex.hxx>
Non-recursive shared mutex.
The gate lives on Base's heap.
Not an alias of std::shared_mutex. Not copyable or movable. One exclusive owner, or several shared owners. unlock and unlock_shared without that ownership are undefined.
◆ SharedMutex() [1/3]
| StormByte::Safe::SharedMutex::SharedMutex |
( |
| ) |
|
Unlocked shared mutex.
- Exceptions
-
◆ SharedMutex() [2/3]
| StormByte::Safe::SharedMutex::SharedMutex |
( |
const SharedMutex & | | ) |
|
|
delete |
◆ SharedMutex() [3/3]
| StormByte::Safe::SharedMutex::SharedMutex |
( |
SharedMutex && | | ) |
|
|
delete |
◆ ~SharedMutex()
| StormByte::Safe::SharedMutex::~SharedMutex |
( |
| ) |
|
|
noexcept |
Destroys the gate on Base's heap.
- Note
- Every owner unlocks before destruction.
◆ lock()
| void StormByte::Safe::SharedMutex::lock |
( |
| ) |
|
Acquire exclusive ownership.
- Exceptions
-
◆ lock_shared()
| void StormByte::Safe::SharedMutex::lock_shared |
( |
| ) |
|
Acquire shared ownership.
- Exceptions
-
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ try_lock()
| bool StormByte::Safe::SharedMutex::try_lock |
( |
| ) |
|
|
noexcept |
Try to acquire exclusive ownership.
- Returns
- Whether this thread now owns it exclusively.
◆ try_lock_shared()
| bool StormByte::Safe::SharedMutex::try_lock_shared |
( |
| ) |
|
|
noexcept |
Try to acquire shared ownership.
- Returns
- Whether this thread now owns it shared.
◆ unlock()
| void StormByte::Safe::SharedMutex::unlock |
( |
| ) |
|
|
noexcept |
Release exclusive ownership.
- Precondition
- The calling thread owns it exclusively.
◆ unlock_shared()
| void StormByte::Safe::SharedMutex::unlock_shared |
( |
| ) |
|
|
noexcept |
Release shared ownership.
- Precondition
- The calling thread owns it shared.
The documentation for this class was generated from the following file: