class that automatically locks and unlocks pthread mutexes To use mlocks in code:
#include <smart_mutex.h>
Public Member Functions | |
mlock (IN smart_mutex &sm) | |
constructor that accepts smart_mutex | |
~mlock (void) | |
destructor automatically unlocks |
class that automatically locks and unlocks pthread mutexes To use mlocks in code:
Example:
void threadsafeFunction(void) { smart_mutex my_mutex; mlock lock(my_mutex); // blocks until mutex is acquired // some stuff that needs to be protected happens here ... } <--- mutex is unlocked here as mlock destructor is called
Definition at line 110 of file smart_mutex.h.
mlock::mlock | ( | IN smart_mutex & | sm | ) | [inline] |
constructor that accepts smart_mutex
Definition at line 113 of file smart_mutex.h.