1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:18:13 +00:00

Kernel: Make it easier to add Thread block states in the future.

This commit is contained in:
Andreas Kling 2019-07-13 20:14:39 +02:00
parent 302cae5c2f
commit 54e79a4640
2 changed files with 7 additions and 1 deletions

View file

@ -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; }