From 5958fd7f8908243338976258e03f18735679f7f2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 15 Jul 2010 12:32:38 -0700 Subject: [PATCH] Clarify that a new goroutine is not started for each finalizer. R=rsc CC=golang-dev https://golang.org/cl/1698051 --- src/pkg/runtime/extern.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go index d3d1dabdf6b..c0cab22e950 100644 --- a/src/pkg/runtime/extern.go +++ b/src/pkg/runtime/extern.go @@ -105,11 +105,11 @@ func Semrelease(s *uint32) // SetFinalizer sets the finalizer associated with x to f. // When the garbage collector finds an unreachable block -// with an associated finalizer, it clears the association and creates -// a new goroutine running f(x). Creating the new goroutine makes -// x reachable again, but now without an associated finalizer. -// Assuming that SetFinalizer is not called again, the next time -// the garbage collector sees that x is unreachable, it will free x. +// with an associated finalizer, it clears the association and runs +// f(x) in a separate goroutine. This makes x reachable again, but +// now without an associated finalizer. Assuming that SetFinalizer +// is not called again, the next time the garbage collector sees +// that x is unreachable, it will free x. // // SetFinalizer(x, nil) clears any finalizer associated with f. //