Update comment

This commit is contained in:
Andy Wang 2020-04-12 16:35:24 +01:00
parent 248389b3f6
commit 73544c03bb
1 changed files with 0 additions and 6 deletions

View File

@ -93,12 +93,6 @@ func (s *Stream) WriteTo(w io.Writer) (int64, error) {
// Write implements io.Write // Write implements io.Write
func (s *Stream) Write(in []byte) (n int, err error) { 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() s.writingM.Lock()
defer s.writingM.Unlock() defer s.writingM.Unlock()
if s.isClosed() { if s.isClosed() {