meeeerged
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user