75 pthread_mutexattr_init(&
a);
76 pthread_mutexattr_settype(&
a,
type);
77 pthread_mutex_init(&
m,&
a);
85 pthread_mutex_destroy(&
m);
93 pthread_mutex_lock(&
m);
104 return pthread_mutex_trylock(&
m);
113 pthread_mutex_unlock(&
m);
144 pthread_mutexattr_t
a;
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
void unlock()
unlocks the mutex
Definition: Mutex.h:111
~Locker()
unlocks the given mutex (automatically called for objects on the stack)
#define ICLUtils_API
this macros are important for creating dll's
Definition: CompatMacros.h:171
Mutex * m
wrapped mutex
Definition: Mutex.h:138
recursive mutex can be locked repeatedly by owner-thread. needs equal unlocks.
Definition: Mutex.h:63
Locker(Mutex *m)
Locks the given mutex until the section is leaved.
enum icl::utils::Mutex::MutexType type
pthread_mutexattr_t a
wrapped thread_mutexattr struct
Definition: Mutex.h:144
Mutex(MutexType type=mutexTypeNormal)
Create a mutex.
Definition: Mutex.h:73
pthread_mutex_t m
wrapped thread_mutex_t struct
Definition: Mutex.h:142
int trylock()
locks the mutex without blocking. returns immediately.
Definition: Mutex.h:102
Interface for objects, that can be locked using an internal mutex.
Definition: Lockable.h:41
normal mutex can not be locked by owner before unlocking
Definition: Mutex.h:61
Mutex class of the ICL.
Definition: Mutex.h:54
Locks a mutex on the stack (mutex is unlocked when the stack's section is released.
Definition: Mutex.h:120
~Mutex()
Destroys the mutex.
Definition: Mutex.h:83
void lock()
locks the mutex
Definition: Mutex.h:91
MutexType
This enum holds available mutex types.
Definition: Mutex.h:58