summaryrefslogtreecommitdiff
path: root/Kernel/Thread.h
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-07-19 09:34:11 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-19 11:03:22 +0200
commitd2ca91c024e0dca3742715392ad5b2cd6125563f (patch)
tree0ee7d8339db8f9dee45e27fb0ca1bc15ce8914d1 /Kernel/Thread.h
parent750dbe986de0b80772c1bd32627850b1105c0e60 (diff)
downloadserenity-d2ca91c024e0dca3742715392ad5b2cd6125563f.zip
Kernel: Convert BlockedSignal and BlockedLurking to the new Blocker mechanism
The last two of the old block states gone :)
Diffstat (limited to 'Kernel/Thread.h')
-rw-r--r--Kernel/Thread.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h
index 6144fb8db2..b2597002f0 100644
--- a/Kernel/Thread.h
+++ b/Kernel/Thread.h
@@ -65,8 +65,6 @@ public:
Stopped,
__Begin_Blocked_States__,
- BlockedLurking,
- BlockedSignal,
BlockedCondition,
__End_Blocked_States__
};
@@ -158,6 +156,20 @@ public:
pid_t& m_waitee_pid;
};
+ class SemiPermanentBlocker : public Blocker {
+ public:
+ enum class Reason {
+ Lurking,
+ Signal,
+ };
+
+ SemiPermanentBlocker(Reason reason);
+ virtual bool should_unblock(Thread&, time_t, long) override;
+
+ private:
+ Reason m_reason;
+ };
+
void did_schedule() { ++m_times_scheduled; }
u32 times_scheduled() const { return m_times_scheduled; }