mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
Kernel: Try to dispatch pending signals on context switch
This ensures that processes that don't perform any syscalls will also eventually receive signals.
This commit is contained in:
parent
0911112286
commit
5fa75dbcda
Notes:
sideshowbarker
2024-07-17 18:25:19 +09:00
Author: https://github.com/IdanHo
Commit: 5fa75dbcda
Pull-request: https://github.com/SerenityOS/serenity/pull/12704
Issue: https://github.com/SerenityOS/serenity/issues/9837
2 changed files with 11 additions and 4 deletions
|
@ -975,8 +975,6 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
|||
return DispatchSignalResult::Deferred;
|
||||
}
|
||||
|
||||
VERIFY(previous_mode() == PreviousMode::UserMode);
|
||||
|
||||
auto& action = m_signal_action_data[signal];
|
||||
// FIXME: Implement SA_SIGINFO signal handlers.
|
||||
VERIFY(!(action.flags & SA_SIGINFO));
|
||||
|
@ -1037,8 +1035,12 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
|||
return DispatchSignalResult::Continue;
|
||||
}
|
||||
|
||||
VERIFY(previous_mode() == PreviousMode::UserMode);
|
||||
VERIFY(current_trap());
|
||||
if (!current_trap()) {
|
||||
// We're trying dispatch a signal to a user process that was scheduled after
|
||||
// a yielding/blocking kernel thread, we don't have a register capture of the
|
||||
// thread, so just defer processing the signal to later.
|
||||
return DispatchSignalResult::Deferred;
|
||||
}
|
||||
|
||||
ScopedAddressSpaceSwitcher switcher(m_process);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue