Commit b167d8d
committed
Always deliver postponed job to main ractor
Profilers use `rb_postponed_job_register_one()` in signal handlers, and
signals don't necessarily land on a thread that runs Ruby code and has a
thread local execution context. The MJIT worker thread doesn't have an
execution context, for example.
Without an execution context, postponed job APIs were crashing. Always
use the main ractor's execution context so postponed job APIs can work
from non Ruby threads like in older versions.
Tests courtesy of John Crepezzi <john.crepezzi@gmail.com> and
John Hawthorn <john@hawthorn.email>.
[Bug #17573]1 parent 0fb782e commit b167d8d
File tree
3 files changed
+42
-4
lines changed- ext/-test-/postponed_job
- test/-ext-/postponed_job
3 files changed
+42
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
61 | 89 | | |
62 | 90 | | |
63 | 91 | | |
64 | 92 | | |
65 | 93 | | |
66 | 94 | | |
67 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
68 | 99 | | |
69 | 100 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1599 | 1599 | | |
1600 | 1600 | | |
1601 | 1601 | | |
1602 | | - | |
1603 | | - | |
| 1602 | + | |
| 1603 | + | |
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
| |||
1618 | 1618 | | |
1619 | 1619 | | |
1620 | 1620 | | |
1621 | | - | |
1622 | | - | |
| 1621 | + | |
| 1622 | + | |
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
| |||
0 commit comments