[winpr,utils] Set Queue_Enqueue only once
In #10527 performance was measured and SetEvent did take a lot of time in these measurements. The reset is only required once though, so use a more fine grained trigger condition.
This commit is contained in:
parent
d0addb52bd
commit
efde29f362
@ -215,7 +215,11 @@ BOOL Queue_Enqueue(wQueue* queue, const void* obj)
|
|||||||
queue->array[queue->tail] = cnv.v;
|
queue->array[queue->tail] = cnv.v;
|
||||||
}
|
}
|
||||||
queue->tail = (queue->tail + 1) % queue->capacity;
|
queue->tail = (queue->tail + 1) % queue->capacity;
|
||||||
|
|
||||||
|
const BOOL signalSet = queue->size == 0;
|
||||||
queue->size++;
|
queue->size++;
|
||||||
|
|
||||||
|
if (signalSet)
|
||||||
SetEvent(queue->event);
|
SetEvent(queue->event);
|
||||||
out:
|
out:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user