summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-06 17:27:12 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-06 17:34:24 +0100
commitd0b2949b4d249f7d6f0db652e2f893c1fff42e33 (patch)
treeef77e44b5566eccb4dfad043e4bcbd85236b371f
parenta1b63bb6d4b7231c3e148efcd20a47a015420b90 (diff)
downloadserenity-d0b2949b4d249f7d6f0db652e2f893c1fff42e33.zip
AK: Lock should ASSERT_INTERRUPTS_ENABLED().
Trying to take a Lock while interrupts are disabled is always a bug.
-rw-r--r--AK/Lock.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/AK/Lock.h b/AK/Lock.h
index 36cf5095cb..b5dc2e5396 100644
--- a/AK/Lock.h
+++ b/AK/Lock.h
@@ -52,6 +52,7 @@ private:
inline void Lock::lock()
{
+ ASSERT_INTERRUPTS_ENABLED();
ASSERT(!Scheduler::is_active());
for (;;) {
if (CAS(&m_lock, 1, 0) == 0) {