#include <scoped_lock.h>
Public Member Functions | |
scoped_lock (pthread_mutex_t *m) | |
~scoped_lock () | |
void | wait (pthread_cond_t *cond) |
Private Member Functions | |
scoped_lock (const scoped_lock ©) | |
scoped_lock & | operator= (const scoped_lock &rhs) |
Private Attributes | |
pthread_mutex_t * | mutex |
This simple wrapper around the pthread implementation will unlock the mutex when the scoped_lock variable goes out of scope.
Definition at line 15 of file scoped_lock.h.
scoped_lock::scoped_lock | ( | pthread_mutex_t * | m | ) | [inline] |
Construct a scoped lock given a pthread mutex.
m | the mutex to be locked for the duration of instance. |
Definition at line 24 of file scoped_lock.h.
References mutex.
scoped_lock::~scoped_lock | ( | ) | [inline] |
Unlock the pthread mutex on scoped lock destruction.
Definition at line 31 of file scoped_lock.h.
References mutex.
scoped_lock::scoped_lock | ( | const scoped_lock & | copy | ) | [private] |
void scoped_lock::wait | ( | pthread_cond_t * | cond | ) | [inline] |
Wait on the pthread mutex given the specified condition variable.
cond | condition variable on whose signal to wait |
Definition at line 39 of file scoped_lock.h.
References mutex.
Referenced by shm_queue< T >::pop().
scoped_lock& scoped_lock::operator= | ( | const scoped_lock & | rhs | ) | [private] |
pthread_mutex_t* scoped_lock::mutex [private] |
Definition at line 47 of file scoped_lock.h.
Referenced by scoped_lock(), wait(), and ~scoped_lock().
Project shmq hosted by | Documentation generated on Sat Sep 2 10:07:40 2006 for shmq by 1.4.6 |