Commit 605f78e
committed
JavaScriptEventLoop: release the isSpinning latch with defer
`runAllJobs()` clears `queueState.isSpinning` only as its final statement, so
the flag survives as `true` if a job unwinds. `insertJobQueue` schedules a
drain only when `!isSpinning`, so after one unwound job the queue is never
drained again: every subsequent `enqueue` appends to a queue nothing will
run, for the lifetime of the process.
Nothing reports it. The failure is silent and total for asynchronous work,
while synchronous calls into the module keep working normally — which makes it
present as "async stopped" rather than as a crash.
Wrapping the reset in `defer` restores the invariant on every exit path. No
behaviour change on the normal path.1 parent cadafdc commit 605f78e
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
| |||
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
53 | | - | |
54 | | - | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| |||
0 commit comments