From 76479f3e807ad359b9fb7926031f21607659aacb Mon Sep 17 00:00:00 2001 From: Loic Guegan <loic.guegan@mailbox.org> Date: Thu, 31 Aug 2023 13:48:15 +0200 Subject: [PATCH] Minor changes --- src/publisher.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/publisher.c b/src/publisher.c index 5b01c7c..f6e173a 100644 --- a/src/publisher.c +++ b/src/publisher.c @@ -102,11 +102,8 @@ int main(int argc, char *argv[]) { //----- Start logging printf("Logger started [client=%s,interval=%ds]\n", client, loginterval); while (!__stop) { - // Wait for next queue to be available: - queue_id = (queue_id + 1) >= MAX_QUEUES ? 0 : (queue_id + 1); // Busy wait: - while (queues[queue_id].issending) { - }; + while (queues[queue_id].issending) {} // Get current interval interval = INTERVAL(loginterval); // Write msg header: @@ -141,6 +138,8 @@ int main(int argc, char *argv[]) { #endif } queues[queue_id].issending = 1; + // Wait for next queue to be available: + queue_id = (queue_id + 1) >= MAX_QUEUES ? 0 : (queue_id + 1); } //----- Cleaning