Qore Programming Language Reference Manual  0.8.9
 All Classes Namespaces Functions Variables Groups Pages
QC_Counter.dox.h
1 namespace Qore::Thread {
4 
11 class Counter {
12 
13 public:
15 
24  constructor(softint c = 0);
25 
26 public:
28 
33  copy();
34 
35 public:
37 
46 nothing dec();
47 
48 public:
50 
59  destructor();
60 
61 public:
63 
73 int getCount();
74 
75 public:
77 
87 int getWaiting();
88 
89 public:
91 
96 nothing inc();
97 
98 public:
100 
107 nothing waitForZero();
108 
109 public:
111 
123 int waitForZero(timeout timeout_ms);
124 };
125 };
int getCount()
Returns the current counter value.
destructor()
Destroys the Counter object.
int getWaiting()
Returns the number of threads currently blocked on this object.
nothing inc()
Atomically increments the counter value.
constructor(softint c=0)
Creates the Counter object.
nothing dec()
Atomically decrements the counter value.
Implements a class that can be used for blocking a thread until a counter reaches zero...
Definition: QC_Counter.dox.h:11
nothing waitForZero()
Blocks a thread until the counter reaches zero.
copy()
Creates a new Counter object with the same count as the original.