diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2014-03-26 15:11:36 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2014-03-26 15:11:36 +0400 |
| commit | f8c350873c94baaf53b9c1c2b6ddfb463172c3de (patch) | |
| tree | 2bf67d8b9dc3ba79f83022a433d8dd606dcb5e00 /src/pkg/runtime/malloc.h | |
| parent | 40f5e67571d6ce299140638e40bea6b00cc76330 (diff) | |
| download | go-f8c350873c94baaf53b9c1c2b6ddfb463172c3de.tar.xz | |
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
Diffstat (limited to 'src/pkg/runtime/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index f4c1bef770..30eccf26f7 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -571,6 +571,10 @@ void runtime·MProf_TraceGC(void); int32 runtime·gcprocs(void); void runtime·helpgc(int32 nproc); void runtime·gchelper(void); +void runtime·createfing(void); +G* runtime·wakefing(void); +extern bool runtime·fingwait; +extern bool runtime·fingwake; void runtime·setprofilebucket(void *p, Bucket *b); |
