#include <mutex.hh>
Inheritance diagram for atoms::Mutex::Mon:


This is the only way to do so for safety.
Definition at line 91 of file mutex.hh.
Public Member Functions | |
| Mon (Mutex &m, bool l=true) | |
| Creates the mutex monitor. | |
| ~Mon () | |
| Unlocks the mutex if it is locked. | |
| void | lock () |
| Locks the mutex. | |
| bool | trylock () |
| Attempts to lock the mutex. | |
| void | unlock () |
| Unlocks the mutex. | |
Static Public Member Functions | |
| void | lockboth (Mon &a, Mon &b) |
| Locks two mutexes. | |
Private Attributes | |
| Mutex & | m |
| The mutex to manage. | |
| bool | locked |
| True iff the mutex is locked through this monitor. | |
Static Private Attributes | |
| DebugLogger | LOGGER |
Friends | |
| class | Condition |
| Conditions directly access the mutex; they pass through the monitor to do so. | |
|
||||||||||||
|
Creates the mutex monitor. The mutex will be locked by default.
|
Here is the call graph for this function:

|
|
Unlocks the mutex if it is locked.
|
Here is the call graph for this function:

|
|
Locks the mutex. Locking is not interruptible.
Definition at line 155 of file mutex.hh. References locked, atoms::DebugLogger::logFatal(), LOGGER, m, atoms::Mutex::me, and NULL. Referenced by lockboth(), and Mon(). |
Here is the call graph for this function:

|
||||||||||||
|
Locks two mutexes. This avoids deadlock by always locking the one with the lower memory address first.
|
Here is the call graph for this function:

|
|
Attempts to lock the mutex.
Definition at line 31 of file mutex.cc. References locked, m, and atoms::Mutex::me. |
|
|
Unlocks the mutex.
Definition at line 175 of file mutex.hh. References locked, atoms::DebugLogger::logFatal(), LOGGER, m, and atoms::Mutex::me. Referenced by ~Mon(). |
Here is the call graph for this function:

|
|
Conditions directly access the mutex; they pass through the monitor to do so.
|
|
|
True iff the mutex is locked through this monitor.
Definition at line 145 of file mutex.hh. Referenced by lock(), Mon(), trylock(), unlock(), and ~Mon(). |
|
|
Reimplemented from atoms::StackOnly. |
|
|
The mutex to manage.
Definition at line 142 of file mutex.hh. Referenced by lock(), lockboth(), trylock(), unlock(), and atoms::Condition::wait(). |
1.3.5