Interface to allow synchronizing the access to derived classes between different threads by making the class lockable by SynchronizedPointer smart pointer objects. Recursive locking is allowed.
More...
|
void | AcquireLock (const std::chrono::milliseconds Timeout) const |
| Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded. Recursive locking is allowed. More...
|
|
void | ReleaseLock () const |
| Releases the internal mutex. Does nothing if the mutex was not locked or if the calling thread is not the current owner of the muetx. More...
|
|
|
std::timed_mutex | LockMutex |
| Internal mutex used for locking. More...
|
|
std::atomic< std::thread::id > | OwnerID |
| ID of the thread which currently owns the internal mutex. More...
|
|
std::atomic< size_t > | OwnedCount |
| Counts the lock requests of the current owning thread. More...
|
|
Interface to allow synchronizing the access to derived classes between different threads by making the class lockable by SynchronizedPointer smart pointer objects. Recursive locking is allowed.
Definition at line 92 of file Util.h.
◆ ISynchronizedPointerLockable()
Util::ISynchronizedPointerLockable::ISynchronizedPointerLockable |
( |
| ) |
|
|
inlineprotected |
◆ ~ISynchronizedPointerLockable()
Util::ISynchronizedPointerLockable::~ISynchronizedPointerLockable |
( |
| ) |
|
|
inlineprotected |
Object should never be destroyed before completely unlocked.
Definition at line 100 of file Util.h.
◆ AcquireLock()
void Util::ISynchronizedPointerLockable::AcquireLock |
( |
const std::chrono::milliseconds |
Timeout | ) |
const |
|
inlineprivate |
Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded. Recursive locking is allowed.
- Parameters
-
Timeout | Time to wait trying to lock the internal mutex. 0 ms means that the functions waits for the mutex without timing out ever. Called by class SynchronizedPointer's constructor. So, default value is given there. |
- Exceptions
-
Definition at line 111 of file Util.h.
◆ ReleaseLock()
void Util::ISynchronizedPointerLockable::ReleaseLock |
( |
| ) |
const |
|
inlineprivate |
Releases the internal mutex. Does nothing if the mutex was not locked or if the calling thread is not the current owner of the muetx.
Definition at line 144 of file Util.h.
◆ SynchronizedPointer
◆ LockMutex
std::timed_mutex Util::ISynchronizedPointerLockable::LockMutex |
|
mutableprivate |
Internal mutex used for locking.
Definition at line 157 of file Util.h.
◆ OwnedCount
std::atomic<size_t> Util::ISynchronizedPointerLockable::OwnedCount |
|
mutableprivate |
Counts the lock requests of the current owning thread.
Definition at line 159 of file Util.h.
◆ OwnerID
std::atomic<std::thread::id> Util::ISynchronizedPointerLockable::OwnerID |
|
mutableprivate |
ID of the thread which currently owns the internal mutex.
Definition at line 158 of file Util.h.
The documentation for this class was generated from the following file: