diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-08-31 13:48:15 +0200 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-08-31 13:48:15 +0200 |
| commit | 76479f3e807ad359b9fb7926031f21607659aacb (patch) | |
| tree | 46a3303a83af23963c8c2d6845329a6adc17de15 /src | |
| parent | d2de7aa0f180c17ea35032d31b596ea59cb9efbb (diff) | |
Minor changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/publisher.c | 7 |
1 files 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 |
