diff --git a/Libraries/LibThread/Lock.h b/Libraries/LibThread/Lock.h index def18517ab..02c97a382f 100644 --- a/Libraries/LibThread/Lock.h +++ b/Libraries/LibThread/Lock.h @@ -72,12 +72,11 @@ ALWAYS_INLINE void Lock::lock() } for (;;) { int expected = 0; - if (m_holder.compare_exchange_strong(expected, tid, AK::memory_order_acq_rel)) { - m_holder = tid; + if (m_holder.compare_exchange_strong(expected, tid, AK::memory_order_acq_rel)) { m_level = 1; return; } - donate(m_holder); + donate(expected); } }