|
Ocean
|
This class implements a scoped lock object that locks two lock objects in a deterministic order based on their memory addresses. More...
#include <Lock.h>
Public Member Functions | |
| DualScopedLockT (TLock &lockA, TLock &lockB) | |
| Creates a new dual scoped lock object based on two given lock objects. | |
| ~DualScopedLockT ()=default | |
| Destructs the dual scoped lock and unlocks both internal lock objects in reverse order. | |
Protected Member Functions | |
| DualScopedLockT (const DualScopedLockT< TScopedLock, TLock > &object)=delete | |
| Disabled accessible copy operator. | |
| DualScopedLockT & | operator= (const DualScopedLockT< TScopedLock, TLock > &object)=delete |
| Disabled accessible assigns operator. | |
Protected Attributes | |
| TScopedLock | scopedLockFirst_ |
| Scopedlock object holding a lock on the lock with the lowest memory address. | |
| TScopedLock | scopedLockSecond_ |
| Scoped lock object holding a lock on the lock with the highest memory address. | |
This class implements a scoped lock object that locks two lock objects in a deterministic order based on their memory addresses.
This prevents potential deadlocks when two threads attempt to lock the same pair of locks in different orders.
| TScopedLock | The type of scoped lock object, e.g., ScopedLock |
| TLock | The underlying lock type |
|
inlineexplicit |
Creates a new dual scoped lock object based on two given lock objects.
The locks will be acquired in a deterministic order based on their memory addresses to prevent deadlock.
| lockA | The first lock object |
| lockB | The second lock object, must not be the same as the first lock object |
|
default |
Destructs the dual scoped lock and unlocks both internal lock objects in reverse order.
|
protecteddelete |
Disabled accessible copy operator.
| object | The object to copy |
|
protecteddelete |
Disabled accessible assigns operator.
| object | The right object |
|
protected |
Scopedlock object holding a lock on the lock with the lowest memory address.
|
protected |
Scoped lock object holding a lock on the lock with the highest memory address.