]> Cypherpunks repositories - gostls13.git/commit
runtime: fix yet another race in bgsweep
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 26 Mar 2014 11:11:36 +0000 (15:11 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 26 Mar 2014 11:11:36 +0000 (15:11 +0400)
commitf8c350873c94baaf53b9c1c2b6ddfb463172c3de
tree2bf67d8b9dc3ba79f83022a433d8dd606dcb5e00
parent40f5e67571d6ce299140638e40bea6b00cc76330
runtime: fix yet another race in bgsweep
Currently it's possible that bgsweep finishes before all spans
have been swept (we only know that sweeping of all spans has *started*).
In such case bgsweep may fail wake up runfinq goroutine when it needs to.
finq may still be nil at this point, but some finalizers may be queued later.
Make bgsweep to wait for sweeping to *complete*, then it can decide
whether it needs to wake up runfinq for sure.
Update #7533

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/75960043
src/pkg/runtime/malloc.goc
src/pkg/runtime/malloc.h
src/pkg/runtime/mgc0.c
src/pkg/runtime/proc.c