1
0
mirror of https://github.com/golang/go synced 2024-11-25 12:27:57 -07:00

Clarify that a new goroutine is not started for each finalizer.

R=rsc
CC=golang-dev
https://golang.org/cl/1698051
This commit is contained in:
Ian Lance Taylor 2010-07-15 12:32:38 -07:00
parent 9867ced972
commit 5958fd7f89

View File

@ -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.
//