#include <synchronized.h>
Public Member Functions | |
void | lock () const |
Acquire the lock; this blocks until the lock is available. | |
Synchronized () | |
Create an initially unlocked mutex. | |
void | unlock () const |
Release the lock. | |
virtual | ~Synchronized () |
The lock is acquired before deconstruction. | |
Protected Attributes | |
pthread_mutex_t | myMutex |
Static Protected Attributes | |
static pthread_mutexattr_t | ourAttr |
static bool | ourInitFlag |
A Synchronized object encapsulates a basic mutex. Only one thread can own the lock at a time. Classes should subclass from Synchronized if they want to be able to lock themselves.
Definition at line 14 of file synchronized.h.
CVD::Synchronized::Synchronized | ( | ) |
Create an initially unlocked mutex.
virtual CVD::Synchronized::~Synchronized | ( | ) | [virtual] |
The lock is acquired before deconstruction.
void CVD::Synchronized::lock | ( | ) | const |
Acquire the lock; this blocks until the lock is available.
This can be called multiple times by the same thread without deadlocking. Each call should have a matching unlock() call.
void CVD::Synchronized::unlock | ( | ) | const |
Release the lock.
pthread_mutex_t CVD::Synchronized::myMutex [mutable, protected] |
Definition at line 33 of file synchronized.h.
pthread_mutexattr_t CVD::Synchronized::ourAttr [static, protected] |
Definition at line 31 of file synchronized.h.
bool CVD::Synchronized::ourInitFlag [static, protected] |
Definition at line 32 of file synchronized.h.