mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
Cleanup
This commit is contained in:
parent
96b4fd7719
commit
878bf3fde7
|
@ -377,10 +377,11 @@ func blockUntilEmptyFinalizerQueue(timeout int64) bool {
|
||||||
// In order to use finalizers correctly, the program must ensure that
|
// In order to use finalizers correctly, the program must ensure that
|
||||||
// the object is reachable until it is no longer required.
|
// the object is reachable until it is no longer required.
|
||||||
// Objects stored in global variables, or that can be found by tracing
|
// Objects stored in global variables, or that can be found by tracing
|
||||||
// pointers from a global variable, are reachable. For other objects,
|
// pointers from a global variable, are reachable. A function argument or
|
||||||
// including receivers, pass the object to a call of the [KeepAlive]
|
// receiver may become unreachable at the last point where the function
|
||||||
// function to mark the last point in the function where the object must
|
// mentions it. To make an unreachable object reachable, pass the object
|
||||||
// be reachable.
|
// to a call of the [KeepAlive] function to mark the last point in the
|
||||||
|
// function where the object must be reachable.
|
||||||
//
|
//
|
||||||
// For example, if p points to a struct, such as os.File, that contains
|
// For example, if p points to a struct, such as os.File, that contains
|
||||||
// a file descriptor d, and p has a finalizer that closes that file
|
// a file descriptor d, and p has a finalizer that closes that file
|
||||||
|
|
Loading…
Reference in a new issue