mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-17 05:39:53 +00:00
Allow the input queue to drain before terminating the thread
This ensures any final input messages (like key ups) make it to the host
This commit is contained in:
@@ -361,14 +361,15 @@ int stopInputStream(void) {
|
||||
// No more packets should be queued now
|
||||
initialized = false;
|
||||
|
||||
// Signal the input send thread
|
||||
LbqSignalQueueShutdown(&packetQueue);
|
||||
PltInterruptThread(&inputSendThread);
|
||||
// Signal the input send thread to drain all pending
|
||||
// input packets before shutting down.
|
||||
LbqSignalQueueDrain(&packetQueue);
|
||||
|
||||
if (inputSock != INVALID_SOCKET) {
|
||||
shutdownTcpSocket(inputSock);
|
||||
}
|
||||
|
||||
PltInterruptThread(&inputSendThread);
|
||||
PltJoinThread(&inputSendThread);
|
||||
PltCloseThread(&inputSendThread);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user