aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/time.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-11-12 17:22:28 -0800
committerIan Lance Taylor <iant@golang.org>2019-11-13 18:03:37 +0000
commite762378c42b786233ea13affa1cc2ee132ceefaf (patch)
tree5f68f5d1e61cb315e630840a7f513bbe4750aa6a /src/runtime/time.go
parentbf4990522263503a1219372cd8f1ee9422b51324 (diff)
downloadgo-e762378c42b786233ea13affa1cc2ee132ceefaf.tar.gz
go-e762378c42b786233ea13affa1cc2ee132ceefaf.zip
runtime: acquire timersLocks around moveTimers
In the discussion of CL 171828 we decided that it was not necessary to acquire timersLock around the call to moveTimers, because the world is stopped. However, that is not correct, as sysmon runs even when the world is stopped, and it calls timeSleepUntil which looks through the timers. timeSleepUntil acquires timersLock, but that doesn't help if moveTimers is running at the same time. Updates #6239 Updates #27707 Updates #35462 Change-Id: I346c5bde594c4aff9955ae430b37c2b6fc71567f Reviewed-on: https://go-review.googlesource.com/c/go/+/206938 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/time.go')
-rw-r--r--src/runtime/time.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/time.go b/src/runtime/time.go
index 39df413ad9..47b326289b 100644
--- a/src/runtime/time.go
+++ b/src/runtime/time.go
@@ -855,8 +855,8 @@ func cleantimers(pp *p) bool {
// moveTimers moves a slice of timers to pp. The slice has been taken
// from a different P.
-// This is currently called when the world is stopped, but it could
-// work as long as the timers for pp are locked.
+// This is currently called when the world is stopped, but the caller
+// is expected to have locked the timers for pp.
func moveTimers(pp *p, timers []*timer) {
for _, t := range timers {
loop: