Browse Source

AK: Lock should ASSERT_INTERRUPTS_ENABLED().

Trying to take a Lock while interrupts are disabled is always a bug.
Andreas Kling 6 years ago
parent
commit
d0b2949b4d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      AK/Lock.h

+ 1 - 0
AK/Lock.h

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