Properly flush the DU queue when we hit the limit. Fixes extreme lag that occurs after streaming for a bit.

This commit is contained in:
Cameron Gutman
2014-08-30 17:07:08 -07:00
parent dc926946dd
commit 0ee1609cc4
4 changed files with 49 additions and 16 deletions
+19
View File
@@ -7,6 +7,25 @@ PLINKED_BLOCKING_QUEUE_ENTRY LbqDestroyLinkedBlockingQueue(PLINKED_BLOCKING_QUEU
return queueHead->head;
}
PLINKED_BLOCKING_QUEUE_ENTRY LbqFlushQueueItems(PLINKED_BLOCKING_QUEUE queueHead) {
PLINKED_BLOCKING_QUEUE_ENTRY head;
PltLockMutex(&queueHead->mutex);
// Save the old head
head = queueHead->head;
// Reinitialize the queue to empty
queueHead->head = NULL;
queueHead->tail = NULL;
queueHead->currentSize = 0;
PltClearEvent(&queueHead->containsDataEvent);
PltUnlockMutex(&queueHead->mutex);
return head;
}
int LbqInitializeLinkedBlockingQueue(PLINKED_BLOCKING_QUEUE queueHead, int sizeBound) {
int err;