• Austin Clements's avatar
    runtime/debug: make SetGCPercent(-1) wait for concurrent GC · 64b68bed
    Austin Clements authored
    Currently, SetGCPercent(-1) disables GC, but doesn't wait for any
    currently running concurrent GC to finish, so GC can still be running
    when it returns. This is a change in behavior from Go 1.8, probably
    defies user expectations, and can break various runtime tests that
    depend on SetGCPercent(-1) to disable garbage collection in order to
    prevent preemption deadlocks.
    
    Fix this by making SetGCPercent(-1) block until any concurrently
    running GC cycle finishes.
    
    Fixes #22443.
    
    Change-Id: I904133a34acf97a7942ef4531ace0647b13930ef
    Reviewed-on: https://go-review.googlesource.com/79195
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    64b68bed
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...