mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
Kernel: Add jail semantics to methods iterating over thread lists
We should consider whether the selected Thread is within the same jail or not. Therefore let's make it clear to callers with jail semantics if a called method checks if the desired Thread object is within the same jail. As for Thread::for_each_* methods, currently nothing in the kernel codebase needs iteration with consideration for jails, so the old Thread::for_each* were simply renamed to include "ignoring_jails" suffix in their names.
This commit is contained in:
@@ -952,7 +952,7 @@ ErrorOr<void> Process::send_signal(u8 signal, Process* sender)
|
||||
{
|
||||
VERIFY(is_user_process());
|
||||
// Try to send it to the "obvious" main thread:
|
||||
auto receiver_thread = Thread::from_tid(pid().value());
|
||||
auto receiver_thread = Thread::from_tid_in_same_jail(pid().value());
|
||||
// If the main thread has died, there may still be other threads:
|
||||
if (!receiver_thread) {
|
||||
// The first one should be good enough.
|
||||
|
||||
Reference in New Issue
Block a user