Classes | Functions | Variables

Threadsafe Collection API
[Mulithreading Libraries]

A set of objects and collection for threadsafe C++ code. More...

Collaboration diagram for Threadsafe Collection API:

Classes

class  smart_mutex
 class that automatically creates and destroys pthread mutexes More...
class  mlock
 class that automatically locks and unlocks pthread mutexes To use mlocks in code:

  • create a mutex (or smart_mutex) that will be locked
  • create an mlock object and pass the mutex in the constructor
  • on destruction, the mlock will automatically unlock the mutex
More...
class  smart_ptr< T >
 Auto-destructing pointer class. More...
class  threadsafe_counter
 Simple synchronized counter. More...
class  threadsafe_map< K, T >
 threadsafe map object More...
class  threadsafe_multimap< K, T >
 A very simple map object that is safe for multiple threads to use at the same time. More...
class  threadsafe_queue< T >

Functions

 smart_mutex::~smart_mutex (void)
 destructor will automatically destroy pthread mutex
pthread_mutex_t * smart_mutex::getMutex (void)
 accessor to retrieve pthread mutex object
 mlock::mlock (pthread_mutex_t *pm)
 constructor that accepts pthread mutex
 mlock::~mlock (void)
 destructor automatically unlocks
 mlock::mlock (void)
 mlock::mlock (const mlock &)
void mlock::lock (pthread_mutex_t *pm)

Variables

pthread_mutex_t smart_mutex::m_mutex
pthread_mutex_t * mlock::m_pm

Detailed Description

A set of objects and collection for threadsafe C++ code.

Assumes use of the posix pthreads libraries.


Function Documentation

smart_mutex::~smart_mutex ( void   )  [inline, inherited]

destructor will automatically destroy pthread mutex

Definition at line 62 of file smart_mutex.h.

pthread_mutex_t* smart_mutex::getMutex ( void   )  [inline, inherited]

accessor to retrieve pthread mutex object

Definition at line 67 of file smart_mutex.h.

mlock::mlock ( pthread_mutex_t *  pm  )  [inline, inherited]

constructor that accepts pthread mutex

Definition at line 105 of file smart_mutex.h.

mlock::~mlock ( void   )  [inline, inherited]

destructor automatically unlocks

Definition at line 110 of file smart_mutex.h.

mlock::mlock ( void   )  [private, inherited]
mlock::mlock ( const mlock  )  [private, inherited]
void mlock::lock ( pthread_mutex_t *  pm  )  [inline, private, inherited]

Definition at line 118 of file smart_mutex.h.


Variable Documentation

pthread_mutex_t smart_mutex::m_mutex [private, inherited]

Definition at line 73 of file smart_mutex.h.

pthread_mutex_t* mlock::m_pm [private, inherited]

Definition at line 125 of file smart_mutex.h.