From 1942e3814bd99ff9466bcbc82eb63d3fab130484 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 18 Jul 2015 23:22:18 -0700 Subject: [PATCH] runtime: clarify runtime.GC blocking behavior The runtime.GC documentation was rewritten in df2809f to make it clear that it blocks until GC is complete, but the re-rewrite in ed9a4c9 and e28a679 lost 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 Reviewed-by: Rob Pike --- src/runtime/mgc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 068372439f..e0818d6441 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -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) } -- 2.50.0