#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 |
Definition at line 35 of file Mutex.h.
zypp::thread::Mutex::Mutex | ( | ) |
Create a new recursive Mutex object.
MutexException | on initialization failure. |
Definition at line 25 of file Mutex.cc.
References _, attr, m_mutex, and ZYPP_THROW_ERRNO_MSG.
zypp::thread::Mutex::~Mutex | ( | ) |
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. |
Definition at line 72 of file Mutex.cc.
References _, m_mutex, and ZYPP_THROW_ERRNO_MSG.
Referenced by zypp::thread::MutexLock::lock().
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. |
Definition at line 82 of file Mutex.cc.
References _, m_mutex, and ZYPP_THROW_ERRNO_MSG.
Referenced by zypp::thread::MutexLock::unlock().
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.
Definition at line 92 of file Mutex.cc.
References m_mutex.
Referenced by zypp::thread::MutexLock::trylock().
RecursiveMutex_t zypp::thread::Mutex::m_mutex [private] |