0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd::ctx::queue: Switch to std::deque backing.

This commit is contained in:
Jason Volk 2019-02-28 10:12:30 -08:00
parent d41be90197
commit 43797c2b74

View file

@ -20,7 +20,7 @@ template<class T>
class ircd::ctx::queue class ircd::ctx::queue
{ {
dock d; dock d;
std::queue<T> q; std::deque<T> q;
size_t w {0}; size_t w {0};
public: public:
@ -54,7 +54,7 @@ void
ircd::ctx::queue<T>::push(T&& t) ircd::ctx::queue<T>::push(T&& t)
noexcept noexcept
{ {
q.push(std::forward<T>(t)); q.push_back(std::forward<T>(t));
d.notify(); d.notify();
} }
@ -62,7 +62,7 @@ template<class T>
void void
ircd::ctx::queue<T>::push(const T &t) ircd::ctx::queue<T>::push(const T &t)
{ {
q.push(t); q.push_back(t);
d.notify(); d.notify();
} }
@ -92,7 +92,7 @@ ircd::ctx::queue<T>::pop()
assert(!q.empty()); assert(!q.empty());
auto ret(std::move(q.front())); auto ret(std::move(q.front()));
q.pop(); q.pop_front();
return ret; return ret;
} }