mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: add new modtimer function
This adds a new field to P, adjustTimers, that tells the P that one of its existing timers was modified to be earlier, and that it therefore needs to resort them. Updates #27707 Change-Id: I4c5f5b51ed116f1d898d3f87cdddfa1b552337f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/171832 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
a813d3c788
commit
48eb79ec21
3 changed files with 107 additions and 1 deletions
|
|
@ -607,6 +607,12 @@ type p struct {
|
|||
// Must hold timersLock to access.
|
||||
timers []*timer
|
||||
|
||||
// Number of timerModifiedEarlier timers on P's heap.
|
||||
// This should only be modified while holding timersLock,
|
||||
// or while the timer status is in a transient state
|
||||
// such as timerModifying.
|
||||
adjustTimers uint32
|
||||
|
||||
pad cpu.CacheLinePad
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue