21 #include <boost/thread.hpp> 41 void setCapacity(
int capacity_);
42 int getCapacity()
const;
43 void produce(T chunk);
58 boost::condition_variable canProduce;
59 boost::condition_variable canConsume;
72 boost::unique_lock<boost::mutex> lock(mut);
74 while (chunks.size() == (size_t) capacity) {
75 canProduce.wait(lock);
80 canConsume.notify_all();
86 boost::unique_lock<boost::mutex> lock(mut);
87 while (chunks.empty()) {
88 canConsume.wait(lock);
90 chunk = chunks.front();
93 canProduce.notify_all();
102 return chunks.empty();
An executable object that can be published for others to discover.
Definition: api.cc:7