CVD 0.8
Public Member Functions | Protected Attributes
CVD::Synchronized Class Reference

A Synchronized object encapsulates a basic mutex. More...

#include <synchronized.h>

Inheritance diagram for CVD::Synchronized:
CVD::NoCopy CVD::EventObject

List of all members.

Public Member Functions

 Synchronized ()
virtual ~Synchronized ()
void lock () const
void unlock () const

Protected Attributes

pthread_mutexattr_t myAttr
pthread_mutex_t myMutex

Detailed Description

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.


Member Function Documentation

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().


The documentation for this class was generated from the following file: