On Windows, this implements a spin-lock. On Linux, this wraps pthread_mutex.
More...
#include <GThread.h>
|
static void | test () |
| Performs unit tests for this class. Throws an exception if there is a failure. More...
|
|
|
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. More...
|
|
On Windows, this implements a spin-lock. On Linux, this wraps pthread_mutex.
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.