From 6101788972fedda42c13791bfac5ffa1218028ed Mon Sep 17 00:00:00 2001 From: Christopher Wedgwood Date: Fri, 5 Nov 2010 15:05:39 -0400 Subject: [PATCH] io: use SetFinalizer more elegantly in Pipe (this works now that issue 751 is resolved) R=rsc CC=golang-dev https://golang.org/cl/2834041 --- src/pkg/io/pipe.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pkg/io/pipe.go b/src/pkg/io/pipe.go index ad949cc6c5a..df76418b93d 100644 --- a/src/pkg/io/pipe.go +++ b/src/pkg/io/pipe.go @@ -292,20 +292,14 @@ func Pipe() (*PipeReader, *PipeWriter) { r.c2 = p.r2 r.cclose = p.rclose r.done = p.done - // TODO(rsc): Should be able to write - // runtime.SetFinalizer(r, (*PipeReader).finalizer) - // but 6g doesn't see the finalizer method. - runtime.SetFinalizer(&r.pipeHalf, (*pipeHalf).finalizer) + runtime.SetFinalizer(r, (*PipeReader).finalizer) w := new(PipeWriter) w.c1 = p.w1 w.c2 = p.w2 w.cclose = p.wclose w.done = p.done - // TODO(rsc): Should be able to write - // runtime.SetFinalizer(w, (*PipeWriter).finalizer) - // but 6g doesn't see the finalizer method. - runtime.SetFinalizer(&w.pipeHalf, (*pipeHalf).finalizer) + runtime.SetFinalizer(w, (*PipeWriter).finalizer) return r, w }