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 {
149 std::queue<T, Container> q;
162 #ifdef CGU_USE_SCHED_YIELD
212 q.push(std::move(obj));
238 template<
class... Args>
241 q.emplace(std::forward<Args>(args)...);
308 obj = std::move(q.front());
375 if (
this != &other) {
376 lock2(mutex, other.mutex);
407 lock2(mutex, rhs.mutex);
410 std::queue<T, Container> temp{rhs.q};
441 q = std::move(rhs.q);
581 std::queue<T, Container> q;
595 #ifdef CGU_USE_SCHED_YIELD
646 q.push(std::move(obj));
673 template<
class... Args>
676 q.emplace(std::forward<Args>(args)...);
744 obj = std::move(q.front());
772 while (q.empty()) cond.
wait(mutex);
816 while (q.empty()) cond.
wait(mutex);
818 obj = std::move(q.front());
911 obj = std::move(q.front());
984 if (
this != &other) {
985 lock2(mutex, other.mutex);
990 if (!other.q.empty()) other.cond.
broadcast();
1029 lock2(mutex, rhs.mutex);
1032 std::queue<T, Container> temp{rhs.q};
1071 q = std::move(rhs.q);
1167 q((Thread::Mutex::Lock(rhs.mutex), rhs.q)) {}
1206 template <
class T,
class Container>
1235 template <
class T,
class Container>