File tree 1 file changed +2
-3
lines changed 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,15 @@ func autoclose(n *gcnotifier) {
67
67
}
68
68
}
69
69
70
- // New creates and arms a new GCNotifier. The *GCNotifier object returned by
71
- // New() must be kept alive until you need to receive the notifications.
70
+ // New creates and arms a new GCNotifier.
72
71
func New () * GCNotifier {
73
72
n := & gcnotifier {
74
73
gcCh : make (chan struct {}, 1 ),
75
74
doneCh : make (chan struct {}, 1 ),
76
75
}
77
76
// sentinel is dead immediately after the call to SetFinalizer
78
77
runtime .SetFinalizer (& sentinel {gcCh : n .gcCh , doneCh : n .doneCh }, finalizer )
79
- // n will be dead when the GCNotifier that wraps it (see the return) is dead
78
+ // n will be dead when the GCNotifier that wraps it (see the return below ) is dead
80
79
runtime .SetFinalizer (n , autoclose )
81
80
// we wrap the internal gcnotifier object in a GCNotifier so that we can
82
81
// safely call autoclose when the GCNotifier becomes unreachable
You can’t perform that action at this time.
0 commit comments