libzypp
10.5.0
|
#include <Mutex.h>
Public Member Functions | |
Mutex () | |
Create a new recursive Mutex object. | |
~Mutex () | |
Destroys this Mutex object. | |
void | lock () |
Acquire ownership of this Mutex object. | |
void | unlock () |
Release ownership of this Mutex object. | |
bool | trylock () |
Try to acquire ownership of this Mutex object. | |
Private Attributes | |
RecursiveMutex_t | m_mutex |
zypp::thread::Mutex::Mutex | ( | ) |
Create a new recursive Mutex object.
MutexException | on initialization failure. |
void zypp::thread::Mutex::lock | ( | ) |
Acquire ownership of this Mutex object.
This call will block if another thread has ownership of this Mutex. When it returns, the current thread is the owner of this Mutex object.
In the same thread, this recursive mutex can be acquired multiple times.
MutexException | if the maximum number of recursive locks for mutex has been exceeded. |
void zypp::thread::Mutex::unlock | ( | ) |
Release ownership of this Mutex object.
If another thread is waiting to acquire the ownership of this mutex it will stop blocking and acquire ownership when this call returns.
MutexException | if the current thread does not own the mutex. |
bool zypp::thread::Mutex::trylock | ( | ) |
Try to acquire ownership of this Mutex object.
This call will return false if another thread has ownership of this Mutex or the maximum number of recursive locks for mutex has been exceeded. When it returns true, the current thread is the owner of this Mutex object.
RecursiveMutex_t zypp::thread::Mutex::m_mutex [private] |