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:
Cameron Gutman committed 2021-05-15 22:01:50 -05:00
1 parent 71c9ff0d91
commit 431e188b07
3 files changed
+57 -17

No files matched your search

+2
View File
@@ -20,6 +20,7 @@ typedef struct _LINKED_BLOCKING_QUEUE {
int sizeBound;
int currentSize;
bool shutdown;
bool draining;
int lifetimeSize;
PLINKED_BLOCKING_QUEUE_ENTRY head;
PLINKED_BLOCKING_QUEUE_ENTRY tail;
@@ -33,4 +34,5 @@ int LbqPeekQueueElement(PLINKED_BLOCKING_QUEUE queueHead, void** data);
PLINKED_BLOCKING_QUEUE_ENTRY LbqDestroyLinkedBlockingQueue(PLINKED_BLOCKING_QUEUE queueHead);
PLINKED_BLOCKING_QUEUE_ENTRY LbqFlushQueueItems(PLINKED_BLOCKING_QUEUE queueHead);
void LbqSignalQueueShutdown(PLINKED_BLOCKING_QUEUE queueHead);
void LbqSignalQueueDrain(PLINKED_BLOCKING_QUEUE queueHead);
int LbqGetItemCount(PLINKED_BLOCKING_QUEUE queueHead);