#include <reader_writer.h>
Nevrax France
Definition at line 40 of file reader_writer.h.
Public Member Functions | |
CReaderWriter () | |
void | enterReader () |
void | enterWriter () |
void | leaveReader () |
void | leaveWriter () |
~CReaderWriter () | |
Private Attributes | |
volatile CMutex | _Fairness |
volatile sint | _ReadersLevel |
volatile CMutex | _ReadersMutex |
volatile CMutex | _RWMutex |
|
Definition at line 32 of file reader_writer.cpp. References _ReadersLevel.
00033 { 00034 _ReadersLevel = 0; 00035 } |
|
Definition at line 37 of file reader_writer.cpp.
00038 {
00039 // here some checks to avoid a reader/writer still working while we flush the mutexes...
00040 }
|
|
Definition at line 54 of file reader_writer.h. References _Fairness, _ReadersLevel, _ReadersMutex, and _RWMutex.
00055 { 00056 const_cast<CMutex&>(_Fairness).enter(); 00057 const_cast<CMutex&>(_ReadersMutex).enter(); 00058 ++_ReadersLevel; 00059 if (_ReadersLevel == 1) 00060 const_cast<CMutex&>(_RWMutex).enter(); 00061 const_cast<CMutex&>(_ReadersMutex).leave(); 00062 const_cast<CMutex&>(_Fairness).leave(); 00063 } |
|
Definition at line 74 of file reader_writer.h. References _Fairness, and _RWMutex.
|
|
Definition at line 65 of file reader_writer.h. References _ReadersLevel, _ReadersMutex, and _RWMutex.
00066 { 00067 const_cast<CMutex&>(_ReadersMutex).enter(); 00068 --_ReadersLevel; 00069 if (_ReadersLevel == 0) 00070 const_cast<CMutex&>(_RWMutex).leave(); 00071 const_cast<CMutex&>(_ReadersMutex).leave(); 00072 } |
|
Definition at line 81 of file reader_writer.h. References _RWMutex.
00082 { 00083 const_cast<CMutex&>(_RWMutex).leave(); 00084 } |
|
Definition at line 44 of file reader_writer.h. Referenced by enterReader(), and enterWriter(). |
|
Definition at line 47 of file reader_writer.h. Referenced by CReaderWriter(), enterReader(), and leaveReader(). |
|
Definition at line 45 of file reader_writer.h. Referenced by enterReader(), and leaveReader(). |
|
Definition at line 46 of file reader_writer.h. Referenced by enterReader(), enterWriter(), leaveReader(), and leaveWriter(). |