00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _QORE_QORECOUNTER_H
00024
00025 #define _QORE_QORECOUNTER_H
00026
00027 #include <qore/Qore.h>
00028 #include <qore/QoreCondition.h>
00029
00031 class QoreCounter
00032 {
00033 private:
00035 struct qore_counter_private *priv;
00036
00038 DLLLOCAL QoreCounter(const QoreCounter&);
00039
00041 DLLLOCAL QoreCounter& operator=(const QoreCounter&);
00042
00043 public:
00045 DLLEXPORT QoreCounter(int nc = 0);
00046
00048 DLLEXPORT ~QoreCounter();
00049
00051 DLLEXPORT void destructor(class ExceptionSink *xsink);
00052
00054 DLLEXPORT void inc();
00055
00057
00061 DLLEXPORT void dec(class ExceptionSink *xsink);
00062
00064
00070 DLLEXPORT int waitForZero(class ExceptionSink *xsink, int timeout_ms = 0);
00071
00073 DLLEXPORT int getCount() const;
00074
00076 DLLEXPORT int getWaiting() const;
00077
00078
00079 DLLLOCAL void waitForZero();
00080 DLLLOCAL void dec();
00081 };
00082
00083 #endif