Reentrant mutex with ownership tracking.
More...
#include <mutex.h>
|
| std::unique_ptr< Impl > | impl_ |
Reentrant mutex with ownership tracking.
Definition at line 14 of file mutex.h.
◆ Mutex() [1/3]
Constructs an unlocked mutex.
◆ ~Mutex()
| contur::Mutex::~Mutex |
( |
| ) |
|
|
override |
◆ Mutex() [2/3]
| contur::Mutex::Mutex |
( |
const Mutex & | | ) |
|
|
delete |
◆ Mutex() [3/3]
| contur::Mutex::Mutex |
( |
Mutex && | | ) |
|
|
noexcept |
◆ acquire()
Acquires the mutex for process pid.
- Returns
- Ok when acquired; ResourceBusy when owned by another process.
Implements contur::ISyncPrimitive.
◆ isLocked()
| bool contur::Mutex::isLocked |
( |
| ) |
const |
|
nodiscardnoexcept |
True when the mutex is owned by some process.
◆ name()
| std::string_view contur::Mutex::name |
( |
| ) |
const |
|
nodiscardoverridevirtualnoexcept |
◆ operator=() [1/2]
| Mutex & contur::Mutex::operator= |
( |
const Mutex & | | ) |
|
|
delete |
◆ operator=() [2/2]
◆ owner()
| std::optional< ProcessId > contur::Mutex::owner |
( |
| ) |
const |
|
nodiscardnoexcept |
Current owner process ID, if locked.
◆ recursionDepth()
| std::size_t contur::Mutex::recursionDepth |
( |
| ) |
const |
|
nodiscardnoexcept |
Reentrancy depth for owner.
◆ release()
Releases the mutex held by process pid.
- Returns
- Ok on success; PermissionDenied/InvalidState on misuse.
Implements contur::ISyncPrimitive.
◆ tryAcquire()
◆ waitingCount()
| std::size_t contur::Mutex::waitingCount |
( |
| ) |
const |
|
nodiscardnoexcept |
Number of waiting processes.
◆ impl_
| std::unique_ptr<Impl> contur::Mutex::impl_ |
|
private |
The documentation for this class was generated from the following file: