meeeerged

This commit is contained in:
Jonas Zeunert
2018-06-07 23:29:15 +02:00
parent 1f0fd916cc
commit f87e7c4c6f
9 changed files with 50 additions and 39 deletions

View File

@@ -26,7 +26,7 @@ public:
void push(T const& value)
{
std::unique_lock<std::mutex> lock(this->d_mutex);
p_queue.push_front(value);
p_queue.push(value);
this->d_condition.notify_one();
}
@@ -34,8 +34,8 @@ public:
{
std::unique_lock<std::mutex> lock(this->d_mutex);
this->d_condition.wait(lock, [=]{ return !this->p_queue.empty(); });
T rc(std::move(this->p_queue.back()));
this->p_queue.pop_back();
T rc = *this->p_queue.end();
this->p_queue.pop();
return rc;
}
};