««« CL
52090045 /
302bdb5b08b1
runtime: fix data race in GC
Fixes #5139.
Update #7065.
R=golang-codereviews, bradfitz, minux.ma
CC=golang-codereviews
https://golang.org/cl/
52090045
»»»
LGTM=r
R=golang-codereviews, r
CC=golang-dev
https://golang.org/cl/
69790043
void
runtime·gchelper(void)
{
+ int32 nproc;
+
gchelperstart();
// parallel mark for over gc roots
runtime·parfordo(work.sweepfor);
bufferList[m->helpgc].busy = 0;
- if(runtime·xadd(&work.ndone, +1) == work.nproc-1)
+ nproc = work.nproc; // work.nproc can change right after we increment work.ndone
+ if(runtime·xadd(&work.ndone, +1) == nproc-1)
runtime·notewakeup(&work.alldone);
}