Commit 5e63a22
committed
Kernel: Don't context-switch when dispatching signals in exit_trap
We shouldn't be context-switching before the very end of this function.
The increment to m_in_critial is meant to prevent that, but
Thread::yield_without_releasing_big_lock() (potentially called by
Thread::check_dispatch_pending_signal) temporarily clears m_in_critial
and forces a context-switch regardless.
To avoid inadvertently context-switching, this patch adds a new argument
to Thread::check_dispatch_pending_signal() which can optionally make it
call Scheduler::yield() directly (which won't context switch while we're
in a critical section).1 parent b9e81af commit 5e63a22
3 files changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
| 626 | + | |
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
638 | 647 | | |
639 | 648 | | |
640 | 649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| |||
878 | 883 | | |
879 | 884 | | |
880 | 885 | | |
881 | | - | |
| 886 | + | |
882 | 887 | | |
883 | 888 | | |
884 | 889 | | |
| |||
0 commit comments