16 #include <condition_variable>
20 using std::unique_lock;
21 using std::condition_variable;
28 template<
class T>
class Quu {
58 count = head = tail = 0;
72 unique_lock<mutex> lck(mtx);
73 count = tail = head = 0;
82 unique_lock<mutex> lck(mtx);
83 qMax = nuSiz;
delete [] buf; buf =
new T[qMax+1];
98 unique_lock<mutex> lck(mtx);
99 while (count == qMax) { fullQ.wait(lck); }
103 tail = (tail + 1) % qMax;
114 unique_lock<mutex> lck(mtx);
115 while (count == 0) { emptyQ.wait(lck); }
119 head = (head + 1) % qMax;