69 #ifndef CGU_ASYNC_QUEUE_H
70 #define CGU_ASYNC_QUEUE_H
83 #ifdef CGU_USE_SCHED_YIELD
99 virtual const char*
what()
const throw() {
return "AsyncQueuePopError: popping from empty AsyncQueue object\n";}
141 template <
class T,
class Container = std::list<T> >
class AsyncQueue {
148 std::queue<T, Container> q;
160 #ifdef CGU_USE_SCHED_YIELD
210 q.push(std::move(obj));
236 template<
class... Args>
239 q.emplace(std::forward<Args>(args)...);
306 obj = std::move(q.front());
373 if (
this != &other) {
374 lock2(mutex, other.mutex);
405 lock2(mutex, rhs.mutex);
408 std::queue<T, Container> temp{rhs.q};
439 q = std::move(rhs.q);
569 std::queue<T, Container> q;
581 #ifdef CGU_USE_SCHED_YIELD
632 q.push(std::move(obj));
659 template<
class... Args>
662 q.emplace(std::forward<Args>(args)...);
730 obj = std::move(q.front());
758 while (q.empty()) cond.
wait(mutex);
802 while (q.empty()) cond.
wait(mutex);
804 obj = std::move(q.front());
897 obj = std::move(q.front());
970 if (
this != &other) {
971 lock2(mutex, other.mutex);
976 if (!other.q.empty()) other.cond.
broadcast();
1015 lock2(mutex, rhs.mutex);
1018 std::queue<T, Container> temp{rhs.q};
1057 q = std::move(rhs.q);
1143 q((Thread::Mutex::Lock(rhs.mutex), rhs.q)) {}
1182 template <
class T,
class Container>
1211 template <
class T,
class Container>