aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgc.go
diff options
context:
space:
mode:
authorMichael Knyszek <mknyszek@google.com>2020-01-24 16:50:53 +0000
committerMichael Knyszek <mknyszek@google.com>2020-01-24 23:27:22 +0000
commitad3cef184e55ab53306a466bda100dc72c40fc3b (patch)
tree3152c14020a7eb1dd5c5bd883b3254ee7a15ea64 /src/runtime/mgc.go
parente948d2b73ede67f12bff9e4d050f0e1425163010 (diff)
downloadgo-ad3cef184e55ab53306a466bda100dc72c40fc3b.tar.gz
go-ad3cef184e55ab53306a466bda100dc72c40fc3b.zip
Revert "runtime: release worldsema before Gosched in STW GC mode"
This reverts commit 05511a5c0ae238325c10b0e4e44c3f66f928e4cf, CL 208379. Reason for revert: So that we can cleanly revert https://golang.org/cl/182657. Change-Id: I4fdf4f864a093db7866b3306f0f8f856b9f4d684 Reviewed-on: https://go-review.googlesource.com/c/go/+/216357 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/mgc.go')
-rw-r--r--src/runtime/mgc.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index bda8eadc9d..0bc5568442 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -1368,13 +1368,6 @@ func gcStart(trigger gcTrigger) {
work.pauseNS += now - work.pauseStart
work.tMark = now
})
-
- // Release the world sema before Gosched() in STW mode
- // because we will need to reacquire it later but before
- // this goroutine becomes runnable again, and we could
- // self-deadlock otherwise.
- semrelease(&worldsema)
-
// In STW mode, we could block the instant systemstack
// returns, so don't do anything important here. Make sure we
// block rather than returning to user code.
@@ -1382,6 +1375,7 @@ func gcStart(trigger gcTrigger) {
Gosched()
}
+ semrelease(&worldsema)
semrelease(&work.startSema)
}