 |
Qore Programming Language - C/C++ Library
0.9.10
|
32 #ifndef _QORE_QORETHREADLOCK_H
34 #define _QORE_QORETHREADLOCK_H
62 pthread_mutex_init(&ptm_lock, ma);
72 pthread_mutex_destroy(&ptm_lock);
82 pthread_mutex_lock(&ptm_lock);
93 pthread_mutex_unlock(&ptm_lock);
102 return pthread_mutex_trylock(&ptm_lock);
107 pthread_mutex_t ptm_lock;
145 DLLLOCAL
void *
operator new(size_t);
166 if (!already_locked) {
175 if (!already_locked) {
204 DLLLOCAL
void *
operator new(size_t);
247 DLLLOCAL
void *
operator new(size_t);
317 DLLLOCAL
void *
operator new(size_t);
337 #endif // _QORE_QORETHREADLOCK_H
DLLLOCAL void unlock()
unlocks the object and updates the locked flag, assumes that the lock is held
Definition: QoreThreadLock.h:283
bool locked
flag indicating if the lock is held or not
Definition: QoreThreadLock.h:254
DLLLOCAL ~QoreThreadLock()
destroys the lock
Definition: QoreThreadLock.h:71
QoreThreadLock * lck
the pointer to the lock that will be managed
Definition: QoreThreadLock.h:251
DLLEXPORT QoreRecursiveThreadLock()
Creates the object.
DLLLOCAL void lock()
grabs the lock (assumes that the lock is unlocked)
Definition: QoreThreadLock.h:78
a thread condition class implementing a wrapper for pthread_cond_t
Definition: QoreCondition.h:45
QoreThreadLock * lck
the pointer to the lock that will be managed
Definition: QoreThreadLock.h:208
provides a safe and exception-safe way to hold locks in Qore, only to be used on the stack,...
Definition: QoreThreadLock.h:136
DLLLOCAL void lock()
locks the object and updates the locked flag, assumes that the lock is not already held
Definition: QoreThreadLock.h:276
QoreThreadLock * lck
the pointer to the lock that will be managed
Definition: QoreThreadLock.h:149
DLLLOCAL int trylock()
attempts to acquire the mutex and returns the status immediately; does not block
Definition: QoreThreadLock.h:101
provides a safe and exception-safe way to release and re-acquire locks in Qore, only to be used on th...
Definition: QoreThreadLock.h:195
DLLLOCAL ~AutoUnlocker()
grabs the lock and destroys the object
Definition: QoreThreadLock.h:223
DLLLOCAL void stay_locked()
will not unlock the lock when the destructor is run; do not use any other functions of this class aft...
Definition: QoreThreadLock.h:290
Implements a recursive lock.
Definition: QoreThreadLock.h:116
provides a safe and exception-safe way to hold optional locks in Qore, only to be used on the stack,...
Definition: QoreThreadLock.h:308
DLLLOCAL QoreThreadLock()
creates the lock
Definition: QoreThreadLock.h:54
provides a mutually-exclusive thread lock
Definition: QoreThreadLock.h:49
provides an exception-safe way to manage locks in Qore, only to be used on the stack,...
Definition: QoreThreadLock.h:238
DLLLOCAL ~SafeLocker()
destroys the object and unlocks the lock if it's held
Definition: QoreThreadLock.h:270
DLLLOCAL void unlock()
releases the lock (assumes that the lock is locked)
Definition: QoreThreadLock.h:89
QoreThreadLock * lck
the pointer to the lock that will be managed
Definition: QoreThreadLock.h:321
DLLLOCAL void relock()
relocks an unlock lock
Definition: QoreThreadLock.h:296
DLLLOCAL ~OptLocker()
releases the lock if there is a lock pointer being managed and destroys the object
Definition: QoreThreadLock.h:331
DLLLOCAL ~AutoLocker()
destroys the object and releases the lock
Definition: QoreThreadLock.h:181