Optimise cond_var predicate order

m_items.empty() is by far the most likely reason for a notification.
This commit is contained in:
Scott Mansell 2023-02-05 17:20:00 +13:00
parent 271ffde71d
commit 2ff155f742
1 changed files with 1 additions and 1 deletions

View File

@ -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();