Mayaqua/Network.c: Fix race condition in TUBE operation
@@ -16731,10 +16731,14 @@ bool TubeSendEx2(TUBE *t, void *data, UINT size, void *header, bool no_flush, UI
UnlockQueue(t->Queue);
if (no_flush == false)
+ {
+ Lock(t->Lock);
{
Set(t->Event);
SetSockEvent(t->SockEvent);
}
+ Unlock(t->Lock);
+ }
return true;
}
@@ -16765,9 +16769,13 @@ void TubeFlushEx(TUBE *t, bool force)
}
}
+ Lock(t->Lock);
+ {
Set(t->Event);
SetSockEvent(t->SockEvent);
}
+ Unlock(t->Lock);
+}
// Receive the data from the tube (asynchronous)
TUBEDATA *TubeRecvAsync(TUBE *t)
