We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89c9d6b commit b3a3afcCopy full SHA for b3a3afc
src/pkg/runtime/mgc0.c
@@ -1956,6 +1956,8 @@ runtime·memorydump(void)
1956
void
1957
runtime·gchelper(void)
1958
{
1959
+ int32 nproc;
1960
+
1961
gchelperstart();
1962
1963
// parallel mark for over gc roots
@@ -1972,7 +1974,8 @@ runtime·gchelper(void)
1972
1974
1973
1975
runtime·parfordo(work.sweepfor);
1976
bufferList[m->helpgc].busy = 0;
- if(runtime·xadd(&work.ndone, +1) == work.nproc-1)
1977
+ nproc = work.nproc; // work.nproc can change right after we increment work.ndone
1978
+ if(runtime·xadd(&work.ndone, +1) == nproc-1)
1979
runtime·notewakeup(&work.alldone);
1980
}
1981
0 commit comments