CVD 0.8
|
A Synchronized object encapsulates a basic mutex. More...
#include <synchronized.h>
Public Member Functions | |
Synchronized () | |
virtual | ~Synchronized () |
void | lock () const |
void | unlock () const |
Protected Attributes | |
pthread_mutexattr_t | myAttr |
pthread_mutex_t | myMutex |
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 16 of file synchronized.h.
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.
Referenced by CVD::MessageQueue< C >::read(), and CVD::MessageQueue< C >::write().