Fix data race in SetSockOpt.

PiperOrigin-RevId: 302539171
This commit is contained in:
Bhasker Hariharan
2020-03-23 16:06:33 -07:00
committed by gVisor bot
parent 6eebaea949
commit 369cf38bd7
+1 -1
View File
@@ -2382,9 +2382,9 @@ func (s *SocketOperations) nonBlockingRead(ctx context.Context, dst usermem.IOSe
// caller-supplied buffer.
s.readMu.Lock()
n, err := s.coalescingRead(ctx, dst, trunc)
s.readMu.Unlock()
cmsg := s.controlMessages()
s.fillCmsgInq(&cmsg)
s.readMu.Unlock()
return n, 0, nil, 0, cmsg, err
}