1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

queue: Fix incorrect signalling on queue push

Pushing zero values to a CQueueSignalled should't wake the
synchronization mechanism.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
This commit is contained in:
Philipp Jungkamp 2023-06-23 13:03:18 +02:00
parent f1c7e0f2a8
commit 3baf5a410f

View file

@ -117,7 +117,7 @@ int villas::node::queue_signalled_push(struct CQueueSignalled *qs, void *ptr)
int pushed;
pushed = queue_push(&qs->queue, ptr);
if (pushed < 0)
if (pushed <= 0)
return pushed;
if (qs->mode == QueueSignalledMode::PTHREAD) {
@ -148,7 +148,7 @@ int villas::node::queue_signalled_push_many(struct CQueueSignalled *qs, void *pt
int pushed;
pushed = queue_push_many(&qs->queue, ptr, cnt);
if (pushed < 0)
if (pushed <= 0)
return pushed;
if (qs->mode == QueueSignalledMode::PTHREAD) {