mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
Kernel: Stop swallowing thread unblocks while process is stopped
This easily led to kernel deadlocks if the stopped thread held an important global mutex (like the disk cache lock) while blocking. Resolve this by ensuring stopped threads have a chance to return to the userland boundary before actually stopping.
This commit is contained in:
parent
458e990b7b
commit
e38ccebfc8
4 changed files with 24 additions and 23 deletions
|
@ -129,7 +129,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap)
|
|||
process.tracer_trap(*current_thread, regs); // this triggers SIGTRAP and stops the thread!
|
||||
}
|
||||
|
||||
current_thread->yield_if_stopped();
|
||||
current_thread->yield_if_should_be_stopped();
|
||||
|
||||
#if ARCH(X86_64)
|
||||
// Apply a random offset in the range 0-255 to the stack pointer,
|
||||
|
@ -178,7 +178,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap)
|
|||
process.tracer_trap(*current_thread, regs); // this triggers SIGTRAP and stops the thread!
|
||||
}
|
||||
|
||||
current_thread->yield_if_stopped();
|
||||
current_thread->yield_if_should_be_stopped();
|
||||
|
||||
current_thread->check_dispatch_pending_signal();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue