Skip to content

Commit

Permalink
LibThread: Remove redundant --m_level in Lock::unlock() (SerenityOS#3040
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tryfinally committed Aug 7, 2020
1 parent 5a5b687 commit 91d259e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Libraries/LibThread/Lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ inline void Lock::unlock()
{
ASSERT(m_holder == gettid());
ASSERT(m_level);
--m_level;
if (!m_level)
if (m_level == 1)
m_holder.store(0, AK::memory_order_release);
else
--m_level;
}

#define LOCKER(lock) LibThread::Locker locker(lock)
Expand Down

0 comments on commit 91d259e

Please sign in to comment.