#include <MboSynch.h>
Public Member Functions | |
virtual void | Enter () const |
virtual bool | Try (DWORD nMilliseconds=0) const =0 |
virtual CLock | GetLock () const =0 |
Protected Member Functions | |
virtual HANDLE | GetHandle () const |
virtual IncDecVal | IncEntered () const =0 |
virtual IncDecVal | DecEntered () const =0 |
Friends | |
class | MutexList |
Internally derived classes must implement a counter for the times Enter() and Leave() are called respectively. This counter must be controlled by the interface build from IncEntered() and DecEntered().
As a direct consequence the user must ensure that for every successfull call to Enter() exactly one call to Leave() is performed.
This class is distributed under the following license GNU Lesser General Public License, version 2.1.
Definition at line 377 of file MboSynch.h.
virtual void mbo::IMutex::Enter | ( | ) | const [inline, virtual] |
Enter Mutex
Implements mbo::ICriticalSection.
Reimplemented in mbo::CMutexImpl, mbo::CMutexFake, and mbo::MutexList.
Definition at line 383 of file MboSynch.h.
00383 { while (!Try(INFINITE)); }
virtual bool mbo::IMutex::Try | ( | DWORD | nMilliseconds = 0 |
) | const [pure virtual] |
Try to enter the Mutex
nMilliseconds | time to try to enter in milliseconds |
Implemented in mbo::CMutexImpl, mbo::CMutexFake, and mbo::MutexList.
virtual CLock mbo::IMutex::GetLock | ( | ) | const [pure virtual] |
Get lock for this mutex
The created lock will be returned as an object. That requires full return by value and invoking copy operators. But that is the only possible solution since we need a local copy that will be destructed locally - the sense of the lock.
Implements mbo::ICriticalSection.
Implemented in mbo::CMutexImpl, mbo::CMutexFake, and mbo::MutexList.
virtual HANDLE mbo::IMutex::GetHandle | ( | ) | const [inline, protected, virtual] |
Reimplemented in mbo::CMutexImpl.
Definition at line 408 of file MboSynch.h.
virtual IncDecVal mbo::IMutex::IncEntered | ( | ) | const [protected, pure virtual] |
Inform that the Mutex was entered.
Implemented in mbo::CMutexImpl, mbo::CMutexFake, and mbo::MutexList.
virtual IncDecVal mbo::IMutex::DecEntered | ( | ) | const [protected, pure virtual] |
Inform that the Mutex was leaved.
Implemented in mbo::CMutexImpl, mbo::CMutexFake, and mbo::MutexList.
friend class MutexList [friend] |
grant MutexList access
Definition at line 379 of file MboSynch.h.
Hosted on code.google.com | © Marcus Börger | Generated on Fri Jan 18 21:21:12 2008 for MBO-lib by ![]() |