Unlock tcp endpoint mutex before blocking forever.

This was occasionally causing tests to get stuck due to races with the save
process, during which the same mutex is acquired.

PiperOrigin-RevId: 340789616
This commit is contained in:
Dean Deng
2020-11-04 22:46:51 -08:00
committed by gVisor bot
parent e29972ec04
commit 771e9ce8e1
+2
View File
@@ -1370,7 +1370,9 @@ func (e *endpoint) protocolMainLoop(handshake bool, wakerInitDone chan<- struct{
drained := e.drainDone != nil
if drained {
close(e.drainDone)
e.mu.Unlock()
<-e.undrain
e.mu.Lock()
}
// Set up the functions that will be called when the main protocol loop