#include <Lock.hpp>
Public Methods | |
| Lock (Mutex &mutex, bool autoLock=true) | |
| virtual | ~Lock () |
| void | get () |
| void | release () |
| void | wait () |
| void | notify () |
| void | notifyAll () |
Private Methods | |
| Lock () | |
| Lock (const Lock &) | |
| Lock & | operator= (Lock &) |
Private Attributes | |
| Mutex & | mutex |
| bool | locked |
|
||||||||||||
|
|
|
|
Definition at line 13 of file Lock.cpp. 00013 {
00014 release();
00015 }
|
|
|
|
|
|
|
|
|
Definition at line 17 of file Lock.cpp. 00017 {
00018 if (!locked) {
00019 mutex.lock();
00020 locked = TRUE;
00021 }
00022 }
|
|
|
Definition at line 39 of file Lock.cpp. 00039 {
00040 if (!locked) {
00041 cout << "Notify on an unlocked mutex.\n";
00042 }
00043
00044 mutex.notify();
00045 }
|
|
|
Definition at line 47 of file Lock.cpp. 00047 {
00048 if (!locked) {
00049 cout << "NotifyAll on an unlocked mutex.\n";
00050 }
00051
00052 mutex.notifyAll();
00053 }
|
|
|
|
|
|
Definition at line 24 of file Lock.cpp. Referenced by ~Lock().
00024 {
00025 if (locked) {
00026 mutex.unlock();
00027 locked = FALSE;
00028 }
00029 }
|
|
|
Definition at line 31 of file Lock.cpp. 00031 {
00032 if (!locked) {
00033 cout << "Waiting on an unlocked mutex.\n";
00034 }
00035
00036 mutex.wait();
00037 }
|
|
|
|
|
|
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001