bool empty() const { TRACE; std::unique_lock<std::mutex> lock(m_mutex); if (m_cancelled) throw CancelledException(); return m_queue.empty(); }
void Foo_C_cust_op2::result(void) { if (this->cancelled_) { throw CancelledException(); } }
void push(const T& value) { TRACE; std::unique_lock<std::mutex> lock(m_mutex); if (m_cancelled) throw CancelledException(); m_queue.push_back(value); m_condVar.notify_one(); }
void Foo_C_cust_op5::result(void) { if (this->cancelled_) { throw CancelledException(); } if (this->exception_) { throw CustomException(); } }
T waitAndPop() { TRACE; std::unique_lock<std::mutex> lock(m_mutex); while (m_queue.empty() && !m_cancelled) m_condVar.wait(lock); if (m_cancelled) throw CancelledException(); T retVal = m_queue.front(); m_queue.pop_front(); return retVal; }