File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -4117,6 +4117,12 @@ func (pp *p) destroy() {
4117
4117
globrunqputhead (pp .runnext .ptr ())
4118
4118
pp .runnext = 0
4119
4119
}
4120
+ if len (pp .timers ) > 0 {
4121
+ plocal := getg ().m .p .ptr ()
4122
+ // The world is stopped so we don't need to hold timersLock.
4123
+ moveTimers (plocal , pp .timers )
4124
+ pp .timers = nil
4125
+ }
4120
4126
// If there's a background worker, make it runnable and put
4121
4127
// it on the global queue so it can clean itself up.
4122
4128
if gp := pp .gcBgMarkWorker .ptr (); gp != nil {
Original file line number Diff line number Diff line change @@ -325,6 +325,14 @@ func timerproc(tb *timersBucket) {
325
325
}
326
326
}
327
327
328
+ // moveTimers moves a slice of timers to pp. The slice has been taken
329
+ // from a different P.
330
+ // This is currently called when the world is stopped, but it could
331
+ // work as long as the timers for pp are locked.
332
+ func moveTimers (pp * p , timers []* timer ) {
333
+ throw ("movetimers: not yet implemented" )
334
+ }
335
+
328
336
// adjusttimers looks through the timers in the current P's heap for
329
337
// any timers that have been modified to run earlier, and puts them in
330
338
// the correct place in the heap.
You can’t perform that action at this time.
0 commit comments