1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

AK: Lock should ASSERT_INTERRUPTS_ENABLED().

Trying to take a Lock while interrupts are disabled is always a bug.
This commit is contained in:
Andreas Kling 2019-02-06 17:27:12 +01:00
parent a1b63bb6d4
commit d0b2949b4d

View file

@ -52,6 +52,7 @@ private:
inline void Lock::lock()
{
ASSERT_INTERRUPTS_ENABLED();
ASSERT(!Scheduler::is_active());
for (;;) {
if (CAS(&m_lock, 1, 0) == 0) {