summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-23 01:28:12 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-23 01:42:04 +0200
commita82b5e6e50c7bb022027d56d96617241a6ea291c (patch)
treee2389f67db4d0a7004e7a7f19b2d333baadcce28
parente51a5e2d5defad8d62f6cee07892821700b9e211 (diff)
downloadserenity-a82b5e6e50c7bb022027d56d96617241a6ea291c.zip
Kernel: Remove unused WaitQueue::should_block(bool)
Nothing ever changed the state of WaitQueue::m_should_block, so this removes the variable entirely.
-rw-r--r--Kernel/WaitQueue.cpp4
-rw-r--r--Kernel/WaitQueue.h7
2 files changed, 2 insertions, 9 deletions
diff --git a/Kernel/WaitQueue.cpp b/Kernel/WaitQueue.cpp
index 4a1d19a322..ebe3a53dbf 100644
--- a/Kernel/WaitQueue.cpp
+++ b/Kernel/WaitQueue.cpp
@@ -15,9 +15,9 @@ bool WaitQueue::should_add_blocker(Thread::Blocker& b, void* data)
VERIFY(data != nullptr); // Thread that is requesting to be blocked
VERIFY(m_lock.is_locked());
VERIFY(b.blocker_type() == Thread::Blocker::Type::Queue);
- if (m_wake_requested || !m_should_block) {
+ if (m_wake_requested) {
m_wake_requested = false;
- dbgln_if(WAITQUEUE_DEBUG, "WaitQueue @ {}: do not block thread {}, {}", this, data, m_should_block ? "wake was pending" : "not blocking");
+ dbgln_if(WAITQUEUE_DEBUG, "WaitQueue @ {}: do not block thread {}", this, data);
return false;
}
dbgln_if(WAITQUEUE_DEBUG, "WaitQueue @ {}: should block thread {}", this, data);
diff --git a/Kernel/WaitQueue.h b/Kernel/WaitQueue.h
index c3c99ac3dc..a9e872852c 100644
--- a/Kernel/WaitQueue.h
+++ b/Kernel/WaitQueue.h
@@ -18,12 +18,6 @@ public:
u32 wake_n(u32 wake_count);
u32 wake_all();
- void should_block(bool block)
- {
- SpinlockLocker lock(m_lock);
- m_should_block = block;
- }
-
template<class... Args>
Thread::BlockResult wait_on(const Thread::BlockTimeout& timeout, Args&&... args)
{
@@ -41,7 +35,6 @@ protected:
private:
bool m_wake_requested { false };
- bool m_should_block { true };
};
}