diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-06 18:45:21 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-06 18:45:21 +0100 |
commit | 6cba80510e2d5310c6ec545e93ab85b18bc7e3c4 (patch) | |
tree | c388a94283c62a7bb6b6350aa5f99f129f118bad /Kernel/Process.h | |
parent | e05237485c50c309a0f79c000418d34e5278eebe (diff) | |
download | serenity-6cba80510e2d5310c6ec545e93ab85b18bc7e3c4.zip |
Kernel: Add a Finalizer process to take care of dying processes.
Instead of processes themselves getting scheduled to finish dying,
let's have a Finalizer process that wakes up whenever someone is dying.
This way we can do all kinds of lock-taking in process cleanup without
risking reentering the scheduler.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r-- | Kernel/Process.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h index fa516f5700..41339740c8 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -60,6 +60,7 @@ public: static Vector<pid_t> all_pids(); static Vector<Process*> all_processes(); + static void finalize_dying_processes(); enum State { Invalid = 0, @@ -70,6 +71,7 @@ public: Dying, Dead, BeingInspected, + BlockedLurking, BlockedSleep, BlockedWait, BlockedRead, @@ -135,6 +137,7 @@ public: void set_selector(word s) { m_far_ptr.selector = s; } void set_state(State s) { m_state = s; } void die(); + void finalize(); pid_t sys$setsid(); pid_t sys$getsid(pid_t); @@ -453,6 +456,7 @@ static inline const char* to_string(Process::State state) case Process::BlockedWrite: return "Write"; case Process::BlockedSignal: return "Signal"; case Process::BlockedSelect: return "Select"; + case Process::BlockedLurking: return "Lurking"; case Process::BeingInspected: return "Inspect"; } ASSERT_NOT_REACHED(); |