From 73544c03bb622454f7994273c86ea81fdcc3b982 Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Sun, 12 Apr 2020 16:35:24 +0100 Subject: [PATCH] Update comment --- internal/multiplex/stream.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/multiplex/stream.go b/internal/multiplex/stream.go index d419380..ce8c434 100644 --- a/internal/multiplex/stream.go +++ b/internal/multiplex/stream.go @@ -93,12 +93,6 @@ func (s *Stream) WriteTo(w io.Writer) (int64, error) { // Write implements io.Write func (s *Stream) Write(in []byte) (n int, err error) { - // RWMutex used here isn't really for RW. - // we use it to exploit the fact that RLock doesn't create contention. - // The use of RWMutex is so that the stream will not actively close - // in the middle of the execution of Write. This may cause the closing frame - // to be sent before the data frame and cause loss of packet. - //log.Tracef("attempting to write %v bytes to stream %v",len(in),s.id) s.writingM.Lock() defer s.writingM.Unlock() if s.isClosed() {