lf_queue: remove explicit notify(), notify in push() instead
Should be cheap enough now if there are no waiters.
This commit is contained in:
@@ -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()) ...
|
||||
|
||||
Reference in New Issue
Block a user