aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/mgc.go')
-rw-r--r--src/runtime/mgc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index cd57720917..8f424926cb 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -1918,7 +1918,7 @@ func gchelper() {
traceGCScanDone()
}
- nproc := work.nproc // work.nproc can change right after we increment work.ndone
+ nproc := atomic.Load(&work.nproc) // work.nproc can change right after we increment work.ndone
if atomic.Xadd(&work.ndone, +1) == nproc-1 {
notewakeup(&work.alldone)
}