mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Join the input thread without interrupting first
Otherwise we'll kill it before it finishes draining
This commit is contained in:
parent
431e188b07
commit
ed9301f3f8
@ -364,14 +364,12 @@ int stopInputStream(void) {
|
|||||||
// Signal the input send thread to drain all pending
|
// Signal the input send thread to drain all pending
|
||||||
// input packets before shutting down.
|
// input packets before shutting down.
|
||||||
LbqSignalQueueDrain(&packetQueue);
|
LbqSignalQueueDrain(&packetQueue);
|
||||||
|
PltJoinThread(&inputSendThread);
|
||||||
|
PltCloseThread(&inputSendThread);
|
||||||
|
|
||||||
if (inputSock != INVALID_SOCKET) {
|
if (inputSock != INVALID_SOCKET) {
|
||||||
shutdownTcpSocket(inputSock);
|
shutdownTcpSocket(inputSock);
|
||||||
}
|
}
|
||||||
|
|
||||||
PltInterruptThread(&inputSendThread);
|
|
||||||
PltJoinThread(&inputSendThread);
|
|
||||||
PltCloseThread(&inputSendThread);
|
|
||||||
|
|
||||||
if (inputSock != INVALID_SOCKET) {
|
if (inputSock != INVALID_SOCKET) {
|
||||||
closeSocket(inputSock);
|
closeSocket(inputSock);
|
||||||
|
@ -167,7 +167,6 @@ void PltUnlockMutex(PLT_MUTEX* mutex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PltJoinThread(PLT_THREAD* thread) {
|
void PltJoinThread(PLT_THREAD* thread) {
|
||||||
LC_ASSERT(thread->cancelled);
|
|
||||||
#if defined(LC_WINDOWS)
|
#if defined(LC_WINDOWS)
|
||||||
WaitForSingleObjectEx(thread->handle, INFINITE, FALSE);
|
WaitForSingleObjectEx(thread->handle, INFINITE, FALSE);
|
||||||
#elif defined(__vita__)
|
#elif defined(__vita__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user