![]() |
Image Component Library (ICL)
|
Mutex class of the ICL. More...
#include <Mutex.h>
Classes | |
| class | Locker |
| Locks a mutex on the stack (mutex is unlocked when the stack's section is released. More... | |
Public Types | |
| enum | MutexType { mutexTypeNormal = PTHREAD_MUTEX_NORMAL, mutexTypeRecursive = PTHREAD_MUTEX_RECURSIVE } |
| This enum holds available mutex types. More... | |
Public Member Functions | |
| Mutex (MutexType type=mutexTypeNormal) | |
| Create a mutex. More... | |
| ~Mutex () | |
| Destroys the mutex. More... | |
| void | lock () |
| locks the mutex More... | |
| int | trylock () |
| locks the mutex without blocking. returns immediately. More... | |
| void | unlock () |
| unlocks the mutex More... | |
Public Attributes | |
| enum icl::utils::Mutex::MutexType | type |
Private Attributes | |
| pthread_mutex_t | m |
| wrapped thread_mutex_t struct More... | |
| pthread_mutexattr_t | a |
| wrapped thread_mutexattr struct More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
| Uncopyable () | |
| Empty base constructor. More... | |
Mutex class of the ICL.
This mutex class is a simple object oriented wrapper of the pthread_mutex_t struct.
Mutices can be:
|
inline |
Create a mutex.
| type | The default MutexType is MutexType::mutexTypeNormal |
|
inline |
Destroys the mutex.
|
inline |
locks the mutex
|
inline |
locks the mutex without blocking. returns immediately.
|
inline |
unlocks the mutex
|
private |
wrapped thread_mutexattr struct
|
private |
wrapped thread_mutex_t struct
| enum icl::utils::Mutex::MutexType icl::utils::Mutex::type |
1.8.15