diff options
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 18 | ||||
-rw-r--r-- | Kernel/Process.h | 2 |
2 files changed, 13 insertions, 7 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 7fee2b8cd8..ea7fbacc98 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -785,13 +785,6 @@ void Process::finalize() m_fds.with_exclusive([](auto& fds) { fds.clear(); }); with_mutable_protected_data([&](auto& protected_data) { protected_data.tty = nullptr; }); m_executable.with([](auto& executable) { executable = nullptr; }); - m_jail_process_list.with([this](auto& list_ptr) { - if (list_ptr) { - list_ptr->attached_processes().with([&](auto& list) { - list.remove(*this); - }); - } - }); m_attached_jail.with([](auto& jail) { if (jail) jail->detach({}); @@ -845,6 +838,17 @@ void Process::unblock_waiters(Thread::WaitBlocker::UnblockFlags flags, u8 signal waiter_process->m_wait_blocker_set.unblock(*this, flags, signal); } +void Process::remove_from_secondary_lists() +{ + m_jail_process_list.with([this](auto& list_ptr) { + if (list_ptr) { + list_ptr->attached_processes().with([&](auto& list) { + list.remove(*this); + }); + } + }); +} + void Process::die() { auto expected = State::Running; diff --git a/Kernel/Process.h b/Kernel/Process.h index 294228e3e4..09798c2da6 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -204,6 +204,8 @@ public: ~Process(); + virtual void remove_from_secondary_lists(); + ErrorOr<NonnullRefPtr<Thread>> create_kernel_thread(void (*entry)(void*), void* entry_data, u32 priority, NonnullOwnPtr<KString> name, u32 affinity = THREAD_AFFINITY_DEFAULT, bool joinable = true); bool is_profiling() const { return m_profiling; } |