Optimise cond_var predicate order
m_items.empty() is by far the most likely reason for a notification.
This commit is contained in:
parent
271ffde71d
commit
2ff155f742
|
@ -147,7 +147,7 @@ private:
|
|||
return;
|
||||
|
||||
m_worker_cond_var.wait(
|
||||
lg, [&] { return m_shutdown || m_cancelling.load() || !m_items.empty(); });
|
||||
lg, [&] { return !m_items.empty() || m_shutdown || m_cancelling.load(); });
|
||||
}
|
||||
T item{std::move(m_items.front())};
|
||||
m_items.pop();
|
||||
|
|
Loading…
Reference in New Issue