Commit 0c74060c authored by Xavier Thompson's avatar Xavier Thompson

event_count.hpp: Fix no waiter optimisation

parent b5e5bdab
......@@ -47,14 +47,18 @@ namespace typon::fdt::lock_free
void notify_one() noexcept
{
_state.fetch_add(shift, std::memory_order_acq_rel);
_state.notify_one();
if (_state.fetch_add(shift, std::memory_order_acq_rel) & mask)
{
_state.notify_one();
}
}
void notify_all() noexcept
{
_state.fetch_add(shift, std::memory_order_acq_rel);
_state.notify_all();
if (_state.fetch_add(shift, std::memory_order_acq_rel) & mask)
{
_state.notify_all();
}
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment