diff --git a/Utilities/cond.cpp b/Utilities/cond.cpp index f62aab8686..96f0bdb99e 100644 --- a/Utilities/cond.cpp +++ b/Utilities/cond.cpp @@ -17,7 +17,8 @@ void cond_variable::imp_wait(u32 _old, u64 _timeout) noexcept // Cleanup m_value.atomic_op([](u32& value) { - value -= c_waiter_mask & -c_waiter_mask; + // Remove waiter (c_waiter_mask) + value -= 1; if ((value & c_waiter_mask) == 0) { diff --git a/Utilities/cond.h b/Utilities/cond.h index 94ac173d13..14de60ff09 100644 --- a/Utilities/cond.h +++ b/Utilities/cond.h @@ -29,7 +29,8 @@ protected: return 0; } - value += c_waiter_mask & -c_waiter_mask; + // Add waiter (c_waiter_mask) + value += 1; return value; }); }