67 #ifndef CGU_ASYNC_QUEUE_H
68 #define CGU_ASYNC_QUEUE_H
81 #ifdef CGU_USE_SCHED_YIELD
97 virtual const char*
what()
const throw() {
return "AsyncQueuePopError: popping from empty AsyncQueue object\n";}
137 template <
class T,
class Container = std::list<T> >
class AsyncQueue {
145 std::queue<T, Container> q;
158 #ifdef CGU_USE_SCHED_YIELD
208 q.push(std::move(obj));
234 template<
class... Args>
237 q.emplace(std::forward<Args>(args)...);
330 if (
this != &other) {
331 lock2(mutex, other.mutex);
362 lock2(mutex, rhs.mutex);
365 std::queue<T, Container> temp{rhs.q};
396 q = std::move(rhs.q);
537 std::queue<T, Container> q;
551 #ifdef CGU_USE_SCHED_YIELD
602 q.push(std::move(obj));
629 template<
class... Args>
632 q.emplace(std::forward<Args>(args)...);
687 while (q.empty()) cond.
wait(mutex);
801 if (
this != &other) {
802 lock2(mutex, other.mutex);
807 if (!other.q.empty()) other.cond.
broadcast();
846 lock2(mutex, rhs.mutex);
849 std::queue<T, Container> temp{rhs.q};
888 q = std::move(rhs.q);
984 q((Thread::Mutex::Lock(rhs.mutex), rhs.q)) {}
1023 template <
class T,
class Container>
1052 template <
class T,
class Container>