Commit eeabe73
fix(video): make pause/resume race-free by routing through the new dispatcher
Replaces the inline switch in onRPCMessage with a pair of regular
RPCHandler entries flagged TakesSession + Synchronous. The dispatcher
runs them on the per-session rpcQueue pump goroutine — which is the
single sequential consumer of the queue — so a rapid pause→resume pair
can no longer be reordered by the Go scheduler. Previously each RPC
was dispatched via "go onRPCMessage(...)", letting the scheduler
interleave the two helpers so a release could land after the matching
acquire and leave the encoder stopped while the tab was visible.
Reported by Cursor Bugbot:
jetkvm#1455 (comment)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent e7bc932 commit eeabe73
2 files changed
Lines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 125 | | |
142 | 126 | | |
143 | 127 | | |
| |||
1317 | 1301 | | |
1318 | 1302 | | |
1319 | 1303 | | |
| 1304 | + | |
| 1305 | + | |
1320 | 1306 | | |
1321 | 1307 | | |
1322 | 1308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
88 | 104 | | |
89 | 105 | | |
90 | 106 | | |
| |||
0 commit comments