diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 13825bd27b..bb02093e77 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -181,6 +181,9 @@ const char* to_string(Thread::State state) return "Receive"; case Thread::BlockedSnoozing: return "Snoozing"; + case Thread::__Begin_Blocked_States__: + case Thread::__End_Blocked_States__: + break; } kprintf("to_string(Thread::State): Invalid state: %u\n", state); ASSERT_NOT_REACHED(); diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 93c0d99ea2..225152f93e 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -61,6 +61,8 @@ public: Dying, Dead, Stopped, + + __Begin_Blocked_States__, BlockedLurking, BlockedSleep, BlockedWait, @@ -71,6 +73,7 @@ public: BlockedConnect, BlockedReceive, BlockedSnoozing, + __End_Blocked_States__ }; void did_schedule() { ++m_times_scheduled; } @@ -79,7 +82,7 @@ public: bool is_stopped() const { return m_state == Stopped; } bool is_blocked() const { - return m_state == BlockedSleep || m_state == BlockedWait || m_state == BlockedRead || m_state == BlockedWrite || m_state == BlockedSignal || m_state == BlockedSelect; + return m_state > __Begin_Blocked_States__ && m_state < __End_Blocked_States__; } bool in_kernel() const { return (m_tss.cs & 0x03) == 0; }