32 #ifndef _QORE_QORECONDITION_H 34 #define _QORE_QORECONDITION_H 39 #include <qore/QoreThreadLock.h> 74 DLLEXPORT
int wait(pthread_mutex_t *m);
84 DLLEXPORT
int wait(pthread_mutex_t *m,
int timeout_ms);
92 DLLEXPORT
int wait2(pthread_mutex_t *m,
int64 timeout_ms);
100 return wait(&l->ptm_lock);
112 return wait(&l->ptm_lock, timeout_ms);
122 return wait2(&l->ptm_lock, timeout_ms);
143 return wait(&l, timeout_ms);
153 return wait2(&l, timeout_ms);
157 #endif // QORE_CONDITION DLLEXPORT int signal()
signals a single waiting thread to wake up
a thread condition class implementing a wrapper for pthread_cond_t
Definition: QoreCondition.h:45
DLLEXPORT int broadcast()
singles all threads blocked on this condition to wake up
DLLEXPORT ~QoreCondition()
destroys the condition object
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:260
provides a mutually-exclusive thread lock
Definition: QoreThreadLock.h:47
DLLEXPORT QoreCondition()
creates the condition object
DLLEXPORT int wait2(pthread_mutex_t *m, int64 timeout_ms)
blocks a thread on a mutex for a certain number of milliseconds until the condition is signaled ...
DLLEXPORT int wait(pthread_mutex_t *m)
blocks a thread on a mutex until the condition is signaled