#include <LOW_thread_mutex_POSIX.h>
Inheritance diagram for LOW_thread_mutex_POSIX:
Public Types | |
enum | mutexKind_t { mutexKind_fast = 0, mutexKind_recursive, mutexKind_errorCheck } |
Basic type of a mutex. More... | |
Public Member Functions | |
virtual | ~LOW_thread_mutex_POSIX () |
Destructor. | |
virtual void | lock () |
Obtain a lock on the mutex (blocking). | |
virtual void | tryLock () |
Obtain a lock on the mutex (non-blocking). | |
virtual void | unlock () |
Release a lock on the mutex. | |
class_DERIVE_FROM_EXCEPTION (thread_mutex_error, LOW_exception) | |
Exception base class for all exceptions thrown by LOW_thread_mutex. | |
class_DERIVE_FROM_EXCEPTION (thread_mutex_locked, thread_mutex_error) | |
Exception class to indicate a mutex already locked by the calling thread. | |
class_DERIVE_FROM_EXCEPTION (thread_mutex_busy, thread_mutex_error) | |
Exception class to indicate a mutex locked by another thread. | |
virtual mutexKind_t | getKind () const |
Get kind of the mutex. | |
Protected Member Functions | |
LOW_thread_mutex_POSIX (const mutexKind_t inMutexKind) | |
Constructor. | |
Private Attributes | |
pthread_mutexattr_t | mutexAttr |
Initial mutex attributes. | |
pthread_mutex_t | theMutex |
The mutex itself. | |
Friends | |
class | LOW_thread_Factory |
To allow construction. |
This class is thread-safe.
IEEE Standard 1003.1-2003 (http://www.opengroup.org/onlinepubs/007904975/toc.htm)
Parts of the documentation taken from Linux man pages by Xavier Leroy.
Parts of the documentation taken from IEEE Standard 1003.1-2003.
Definition at line 40 of file LOW_thread_mutex_POSIX.h.
|
Basic type of a mutex.
Definition at line 104 of file LOW_thread_mutex.h. Referenced by LOW_thread_mutex::getKind(). |
|
Destructor.
Definition at line 65 of file LOW_thread_mutex_POSIX.cpp. References mutexAttr, LOW_helper_msglog::printPerror(), and theMutex. |
|
Constructor. Not publicly constructable. Use LOW_thread_Factory.
Definition at line 34 of file LOW_thread_mutex_POSIX.cpp. References mutexAttr, LOW_thread_mutex::mutexKind_errorCheck, LOW_thread_mutex::mutexKind_fast, LOW_thread_mutex::mutexKind_recursive, and theMutex. |
|
Exception class to indicate a mutex locked by another thread.
|
|
Exception class to indicate a mutex already locked by the calling thread.
|
|
Exception base class for all exceptions thrown by LOW_thread_mutex.
|
|
Get kind of the mutex.
Definition at line 47 of file LOW_thread_mutex.cpp. References LOW_thread_mutex::mutexKind, and LOW_thread_mutex::mutexKind_t. |
|
Obtain a lock on the mutex (blocking). Blocks the calling thread if another thread has already locked the mutex. If the mutex is already locked by the calling thread, behaviour depends on the mutex kind:
Implements LOW_thread_mutex. Definition at line 82 of file LOW_thread_mutex_POSIX.cpp. References theMutex. |
|
Obtain a lock on the mutex (non-blocking). Behaves identically to lock(), except that it does not block the calling thread if the mutex is already locked by another thread. Instead an thread_mutex_busy exception is thrown.
Implements LOW_thread_mutex. Definition at line 93 of file LOW_thread_mutex_POSIX.cpp. References theMutex. |
|
Release a lock on the mutex. Behaviour depends on the mutex kind:
Implements LOW_thread_mutex. Definition at line 106 of file LOW_thread_mutex_POSIX.cpp. References theMutex. |
|
To allow construction.
Definition at line 122 of file LOW_thread_mutex_POSIX.h. |
|
Initial mutex attributes.
Definition at line 146 of file LOW_thread_mutex_POSIX.h. Referenced by LOW_thread_mutex_POSIX(), and ~LOW_thread_mutex_POSIX(). |
|
The mutex itself.
Definition at line 147 of file LOW_thread_mutex_POSIX.h. Referenced by lock(), LOW_thread_mutex_POSIX(), tryLock(), unlock(), and ~LOW_thread_mutex_POSIX(). |