Minor changes

This commit is contained in:
Loïc Guégan 2023-08-31 13:48:15 +02:00
parent d2de7aa0f1
commit 76479f3e80

View file

@ -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