mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: handle timers on P's in procresize/(*pp).destroy
Updates #6239 Updates #27707 Change-Id: I52cab8bf3dc8c552463725fc1d9e4e6b12230b03 Reviewed-on: https://go-review.googlesource.com/c/go/+/171828 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
9989221ac1
commit
6b3bb4ba3b
2 changed files with 14 additions and 0 deletions
|
|
@ -4117,6 +4117,12 @@ func (pp *p) destroy() {
|
|||
globrunqputhead(pp.runnext.ptr())
|
||||
pp.runnext = 0
|
||||
}
|
||||
if len(pp.timers) > 0 {
|
||||
plocal := getg().m.p.ptr()
|
||||
// The world is stopped so we don't need to hold timersLock.
|
||||
moveTimers(plocal, pp.timers)
|
||||
pp.timers = nil
|
||||
}
|
||||
// If there's a background worker, make it runnable and put
|
||||
// it on the global queue so it can clean itself up.
|
||||
if gp := pp.gcBgMarkWorker.ptr(); gp != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue