shared_mutex: Optimize busy-waiting by detecting waiters and try to steal the notifying bit

Add an unused has_waiters() method.
This commit is contained in:
Eladash 2022-08-07 17:48:14 +03:00 committed by Ivan
parent 26e731b487
commit 2ec039365f
2 changed files with 34 additions and 3 deletions

View file

@ -171,6 +171,11 @@ public:
{
return m_value.load() < c_one - 1;
}
bool has_waiters() const
{
return m_value.load() > c_one;
}
};
// Simplified shared (reader) lock implementation.