lf_queue: remove explicit notify(), notify in push() instead

Should be cheap enough now if there are no waiters.
This commit is contained in:
Nekotekina 2019-10-12 22:45:17 +03:00
parent 5624b001ae
commit ac712bf4e3
2 changed files with 6 additions and 10 deletions

View file

@ -363,11 +363,6 @@ public:
}
}
void notify() noexcept
{
m_head.notify_one();
}
template <typename... Args>
void push(Args&&... args)
{
@ -378,6 +373,12 @@ public:
{
item->m_link = reinterpret_cast<lf_queue_item<T>*>(_old);
}
if (!_old)
{
// Notify only if queue was empty
m_head.notify_one();
}
}
// Withdraw the list, supports range-for loop: for (auto&& x : y.pop_all()) ...