mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Fix size tracking in LBQ
This commit is contained in:
parent
638787d3dd
commit
b5430217dd
@ -87,12 +87,14 @@ int LbqWaitForQueueElement(PLINKED_BLOCKING_QUEUE queueHead, void** data) {
|
|||||||
|
|
||||||
entry = queueHead->head;
|
entry = queueHead->head;
|
||||||
queueHead->head = entry->next;
|
queueHead->head = entry->next;
|
||||||
|
queueHead->currentSize--;
|
||||||
|
|
||||||
*data = entry->data;
|
*data = entry->data;
|
||||||
|
|
||||||
free(entry);
|
free(entry);
|
||||||
|
|
||||||
if (queueHead->head == NULL) {
|
if (queueHead->head == NULL) {
|
||||||
|
LC_ASSERT(queueHead->currentSize == 0);
|
||||||
PltClearEvent(&queueHead->containsDataEvent);
|
PltClearEvent(&queueHead->containsDataEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user