1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:18:13 +00:00

LibThread: Remove redundant --m_level in Lock::unlock() (#3040)

This commit is contained in:
Muhammad Zahalqa 2020-08-07 18:24:49 +03:00 committed by GitHub
parent 5a5b687014
commit 91d259ef1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)