Fix size tracking in LBQ
This commit is contained in:
parent
638787d3dd
commit
b5430217dd
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue