GClasses
|
A spin-lock for synchronization purposes. More...
#include <GSpinLock.h>
Public Member Functions | |
GSpinLock () | |
virtual | ~GSpinLock () |
void | lock (const char *szWhoHoldsTheLock) |
void | unlock () |
bool | isLocked () |
Static Public Member Functions | |
static void | test () |
Performs unit tests for this class. Throws an exception if there is a failure. | |
Protected Attributes | |
volatile long | m_dwLocked |
pthread_mutex_t | m_mutex |
maintaned on all platform as posix mutexes don't have a way to get current state. when not Win32 be aware that this value is shadowing the real mutex, and cannot be depended on especially in a MP enviroment. |
A spin-lock for synchronization purposes.
GClasses::GSpinLock::GSpinLock | ( | ) |
virtual GClasses::GSpinLock::~GSpinLock | ( | ) | [virtual] |
bool GClasses::GSpinLock::isLocked | ( | ) | [inline] |
void GClasses::GSpinLock::lock | ( | const char * | szWhoHoldsTheLock | ) |
static void GClasses::GSpinLock::test | ( | ) | [static] |
Performs unit tests for this class. Throws an exception if there is a failure.
void GClasses::GSpinLock::unlock | ( | ) |
volatile long GClasses::GSpinLock::m_dwLocked [protected] |
pthread_mutex_t GClasses::GSpinLock::m_mutex [protected] |
maintaned on all platform as posix mutexes don't have a way to get current state. when not Win32 be aware that this value is shadowing the real mutex, and cannot be depended on especially in a MP enviroment.