|
Qore Programming Language
0.9.16
|
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;
152 if (!already_locked) {
161 if (!already_locked) {
174 DLLLOCAL
void *
operator new(size_t) =
delete;
212 DLLLOCAL
void *
operator new(size_t) =
delete;
278 DLLLOCAL
void *
operator new(size_t) =
delete;
310 DLLLOCAL
void *
operator new(size_t) =
delete;
317 #endif // _QORE_QORETHREADLOCK_H
DLLLOCAL void unlock()
unlocks the object and updates the locked flag, assumes that the lock is held
Definition: QoreThreadLock.h:256
bool locked
flag indicating if the lock is held or not
Definition: QoreThreadLock.h:285
DLLLOCAL ~QoreThreadLock()
destroys the lock
Definition: QoreThreadLock.h:71
QoreThreadLock * lck
the pointer to the lock that will be managed
Definition: QoreThreadLock.h:282
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:216
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:249
QoreThreadLock * lck
the pointer to the lock that will be managed
Definition: QoreThreadLock.h:178
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:190
DLLLOCAL ~AutoUnlocker()
grabs the lock and destroys the object
Definition: QoreThreadLock.h:204
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:263
DLLLOCAL AutoLocker(QoreThreadLock *l)
creates the object and grabs the lock
Definition: QoreThreadLock.h:139
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:293
DLLLOCAL QoreThreadLock()
creates the lock
Definition: QoreThreadLock.h:54
DLLLOCAL OptLocker(QoreThreadLock *l)
creates the object and grabs the lock if the argument is not NULL
Definition: QoreThreadLock.h:296
DLLLOCAL AutoUnlocker(QoreThreadLock *l)
creates the object and releases the lock
Definition: QoreThreadLock.h:193
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:228
DLLLOCAL ~SafeLocker()
destroys the object and unlocks the lock if it's held
Definition: QoreThreadLock.h:243
DLLLOCAL SafeLocker(QoreThreadLock *l)
creates the object and grabs the lock
Definition: QoreThreadLock.h:231
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:314
DLLLOCAL void relock()
relocks an unlock lock
Definition: QoreThreadLock.h:269
DLLLOCAL ~OptLocker()
releases the lock if there is a lock pointer being managed and destroys the object
Definition: QoreThreadLock.h:302
DLLLOCAL ~AutoLocker()
destroys the object and releases the lock
Definition: QoreThreadLock.h:167