Scoped POSIX thread mutex lock is valid for the current scope of the object. More...
#include <pthread.hpp>
Public Member Functions | |
CPthread_scoped_lock (::pthread_mutex_t &a_mutex) | |
Locks given POSIX thread mutex. | |
~CPthread_scoped_lock () | |
Unlock the mutex that was locked by the constructor. | |
Scoped POSIX thread mutex lock is valid for the current scope of the object.
The constructor locks the given mutex and the destructor unlocks it. This way the locked mutex is authomatically unlocked when leaving the current scope, for example on return or with an exception.
std::runtime_error | The mutex has not been properly initialized. |
Definition at line 103 of file pthread.hpp.
UPnPsdk::CPthread_scoped_lock::CPthread_scoped_lock | ( | ::pthread_mutex_t & | a_mutex | ) |
Locks given POSIX thread mutex.
[in] | a_mutex | Mutex used to lock. |
Definition at line 29 of file pthread.cpp.
UPnPsdk::CPthread_scoped_lock::~CPthread_scoped_lock | ( | ) |
Unlock the mutex that was locked by the constructor.
Definition at line 37 of file pthread.cpp.