summaryrefslogtreecommitdiff
path: root/Kernel/Thread.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-24 13:11:58 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-24 16:37:28 +0200
commit0c1d41cc8a10595e4449f9cc92681ee9e90e57c2 (patch)
tree4e237364dc4162d8533cc73c8f404806df69b375 /Kernel/Thread.h
parentadbf472ca7182c96545f0e54aef58560e27656f6 (diff)
downloadserenity-0c1d41cc8a10595e4449f9cc92681ee9e90e57c2.zip
Kernel: Simplify Blockers so they don't need a "should block" flag
The `m_should_block` member variable that many of the Thread::Blocker subclasses had was really only used to carry state from the constructor to the immediate-unblock-without-blocking escape hatch. This patch refactors the blockers so that we don't need to hold on to this flag after setup_blocker(), and instead the return value from setup_blocker() is the authority on whether the unblock conditions are already met.
Diffstat (limited to 'Kernel/Thread.h')
-rw-r--r--Kernel/Thread.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h
index bb926a8998..a4026c7176 100644
--- a/Kernel/Thread.h
+++ b/Kernel/Thread.h
@@ -528,9 +528,7 @@ public:
NonnullRefPtr<Thread> m_joinee;
void*& m_joinee_exit_value;
KResult& m_try_join_result;
- bool m_join_error { false };
bool m_did_unblock { false };
- bool m_should_block { true };
};
class WaitQueueBlocker final : public Blocker {
@@ -548,7 +546,6 @@ public:
protected:
WaitQueue& m_wait_queue;
StringView m_block_reason;
- bool m_should_block { true };
bool m_did_unblock { false };
};
@@ -578,7 +575,6 @@ public:
FutexQueue& m_futex_queue;
u32 m_bitset { 0 };
u32 m_relock_flags { 0 };
- bool m_should_block { true };
bool m_did_unblock { false };
};
@@ -605,9 +601,6 @@ public:
virtual Type blocker_type() const override { return Type::File; }
virtual bool unblock(bool, void*) = 0;
-
- protected:
- bool m_should_block { true };
};
class FileDescriptionBlocker : public FileBlocker {
@@ -734,7 +727,6 @@ public:
bool m_did_unblock { false };
bool m_error { false };
bool m_got_sigchild { false };
- bool m_should_block;
};
class WaitBlockerSet final : public BlockerSet {