libvpb  4.2.61
ScopedMutex Class Reference

Simple exception safe mutex sentinel. More...

#include <scopedmutex.h>

Collaboration diagram for ScopedMutex:
Collaboration graph

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.