Skip to content

Commit

Permalink
Fix lf_queue_base::wait
Browse files Browse the repository at this point in the history
Add missing state change
  • Loading branch information
Nekotekina committed Jun 5, 2019
1 parent b2e0810 commit 1dedeb3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Utilities/cond.cpp
Expand Up @@ -275,6 +275,14 @@ void shared_cond::imp_notify() noexcept

bool lf_queue_base::wait(u64 _timeout)
{
auto _old = m_head.compare_and_swap(0, 1);

if (_old)
{
verify("lf_queue concurrent wait" HERE), _old != 1;
return true;
}

return balanced_wait_until(m_head, _timeout, [](std::uintptr_t& head, auto... ret) -> int
{
if (head != 1)
Expand Down

0 comments on commit 1dedeb3

Please sign in to comment.