32 #ifndef _QORE_QORECOUNTER_H 34 #define _QORE_QORECOUNTER_H 37 #include <qore/QoreCondition.h> 43 hashdecl qore_counter_private* priv;
96 DLLLOCAL
void waitForZero();
a simple thread-safe counter object; objects can block on it until the counter reaches zero ...
Definition: QoreCounter.h:40
DLLEXPORT ~QoreCounter()
destroys the object and frees all memory
DLLEXPORT int dec(ExceptionSink *xsink)
decrements the counter and wakes up any threads if the counter reaches 0
DLLEXPORT int getCount() const
returns the current count
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:46
DLLEXPORT int inc()
increments the counter
DLLEXPORT void destructor(ExceptionSink *xsink)
throws a Qore-language exception if there are any waiting threads and wakes them all up ...
DLLEXPORT int waitForZero(ExceptionSink *xsink, int timeout_ms=0)
blocks the calling thread until the counter reaches 0
DLLEXPORT int getWaiting() const
returns the number of threads blocked on this object