Public Member Functions

ScopedMutex Class Reference

Simple exception safe mutex sentinel. More...

#include <scopedmutex.h>

Collaboration diagram for ScopedMutex:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ScopedMutex (pthread_mutex_t *mutex)
 Lock mutex for the lifetime of this object.
 ~ScopedMutex ()
 Unlock the mutex again.

Detailed Description

Simple exception safe mutex sentinel.

Warning:
This does not, and cannot protect against thread cancellation. It should not be used in such contexts if the mutex held will outlive the thread being cancelled.