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 950555c commit 495b914Copy full SHA for 495b914
src/pkg/runtime/mgc0.c
@@ -1798,6 +1798,8 @@ runtime·memorydump(void)
1798
void
1799
runtime·gchelper(void)
1800
{
1801
+ int32 nproc;
1802
+
1803
gchelperstart();
1804
1805
// parallel mark for over gc roots
@@ -1814,7 +1816,8 @@ runtime·gchelper(void)
1814
1816
1815
1817
runtime·parfordo(work.sweepfor);
1818
bufferList[m->helpgc].busy = 0;
- if(runtime·xadd(&work.ndone, +1) == work.nproc-1)
1819
+ nproc = work.nproc; // work.nproc can change right after we increment work.ndone
1820
+ if(runtime·xadd(&work.ndone, +1) == nproc-1)
1821
runtime·notewakeup(&work.alldone);
1822
}
1823
0 commit comments