mirror of https://github.com/golang/go.git
runtime: clarify runtime.GC blocking behavior
The runtime.GC documentation was rewritten indf2809fto make it clear that it blocks until GC is complete, but the re-rewrite ined9a4c9ande28a679lost this property when clarifying that it may also block the entire program and not just the caller. Try to arrive at wording that conveys both of these properties. Change-Id: I1e255322aa28a21a548556ecf2a44d8d8ac524ef Reviewed-on: https://go-review.googlesource.com/12392 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
692054e76e
commit
1942e3814b
|
|
@ -770,8 +770,9 @@ var work struct {
|
|||
initialHeapLive uint64
|
||||
}
|
||||
|
||||
// GC runs a garbage collection. It might block the entire program until the
|
||||
// collection is complete.
|
||||
// GC runs a garbage collection and blocks the caller until the
|
||||
// garbage collection is complete. It may also block the entire
|
||||
// program.
|
||||
func GC() {
|
||||
startGC(gcForceBlockMode)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue