diff options
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/mgc0.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index 65e51e4d1f..f9d6face09 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -1906,6 +1906,12 @@ bgsweep(void) runtime·ready(fing); } } + if(!runtime·mheap.sweepdone) { + // It's possible if GC has happened between sweepone has + // returned -1 and gclock lock. + runtime·unlock(&gclock); + continue; + } sweep.parked = true; runtime·parkunlock(&gclock, "GC sweep wait"); } |
