|
Open Model Railroad Network (OpenMRN)
|
RAII class for holding a mutex lock that can be upgraded to a critical section lock. More...
#include <BlockOrWakeUp.hxx>
Public Member Functions | |
| LockHolder (BlockOrWakeUp< Critical > *parent) | |
| Constructor. | |
| LockHolder (LockHolder &&o) | |
| Move constructor. | |
| CriticalHolder | critical () |
| upgrades a regular lock to a critical section. | |
| void | wait_for_notification () |
| Waits for the core condition to be true (i.e. | |
| void | notify_next () |
| Hands over the core condition to a next someone waiting in line. | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (LockHolder) | |
Private Attributes | |
| BlockOrWakeUp< Critical > * | parent_ |
| Parent object whose lock we are holding. | |
RAII class for holding a mutex lock that can be upgraded to a critical section lock.
Definition at line 116 of file BlockOrWakeUp.hxx.
|
inline |
Constructor.
As a side effect acquires a regular (non-critical) lock.
| parent | which object to lock. |
Definition at line 120 of file BlockOrWakeUp.hxx.
|
inline |
|
inline |
Definition at line 133 of file BlockOrWakeUp.hxx.
|
inline |
upgrades a regular lock to a critical section.
Definition at line 143 of file BlockOrWakeUp.hxx.
|
inline |
Hands over the core condition to a next someone waiting in line.
Definition at line 159 of file BlockOrWakeUp.hxx.
|
inline |
Waits for the core condition to be true (i.e.
data available for read or space available to write data to). Blocks caller.
Definition at line 151 of file BlockOrWakeUp.hxx.
|
private |
Parent object whose lock we are holding.
Definition at line 176 of file BlockOrWakeUp.hxx.