mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge PR #1441: Mayaqua/Network.c: Fix race condition in TUBE operation
This commit is contained in:
commit
101d79d7c3
@ -16731,10 +16731,14 @@ bool TubeSendEx2(TUBE *t, void *data, UINT size, void *header, bool no_flush, UI
|
|||||||
UnlockQueue(t->Queue);
|
UnlockQueue(t->Queue);
|
||||||
|
|
||||||
if (no_flush == false)
|
if (no_flush == false)
|
||||||
|
{
|
||||||
|
Lock(t->Lock);
|
||||||
{
|
{
|
||||||
Set(t->Event);
|
Set(t->Event);
|
||||||
SetSockEvent(t->SockEvent);
|
SetSockEvent(t->SockEvent);
|
||||||
}
|
}
|
||||||
|
Unlock(t->Lock);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -16765,8 +16769,12 @@ void TubeFlushEx(TUBE *t, bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lock(t->Lock);
|
||||||
|
{
|
||||||
Set(t->Event);
|
Set(t->Event);
|
||||||
SetSockEvent(t->SockEvent);
|
SetSockEvent(t->SockEvent);
|
||||||
|
}
|
||||||
|
Unlock(t->Lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receive the data from the tube (asynchronous)
|
// Receive the data from the tube (asynchronous)
|
||||||
|
Loading…
Reference in New Issue
Block a user