CVD::Synchronized Class Reference

#include <synchronized.h>

Inheritance diagram for CVD::Synchronized:
Inheritance graph
[legend]

List of all members.

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

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 14 of file synchronized.h.


Constructor & Destructor Documentation

CVD::Synchronized::Synchronized (  ) 

Create an initially unlocked mutex.

virtual CVD::Synchronized::~Synchronized (  )  [virtual]

The lock is acquired before deconstruction.


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.

void CVD::Synchronized::unlock (  )  const

Release the lock.


Member Data Documentation

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


libcvd
Author(s): Edward Rosten, Paul Smith, Tom Drummond, Gerhard Reitmayr, Ethan Eade, Timothy Gan, Chris Kemp, Georg Klein
autogenerated on Fri Jan 11 09:13:52 2013