Minor changes

This commit is contained in:
Loïc Guégan 2023-09-12 16:03:31 +02:00
parent f4a3b66017
commit 6d3e13df8e

View file

@ -17,6 +17,7 @@
/// @brief Set to non-zero to stop the processes
unsigned char __stop = 0;
unsigned char __stop_zmq_thread = 0;
/**
* @brief Stop process properly on SIGINT
@ -144,6 +145,7 @@ int main(int argc, char *argv[]) {
//----- Cleaning
close(regfd);
__stop_zmq_thread=1; // Ignite clean stop
pthread_join(zmq_thread, NULL);
zmq_close(zmq_publisher);
zmq_ctx_destroy(zmq_context);
@ -153,7 +155,9 @@ int main(int argc, char *argv[]) {
void *publisher(void *zmq_publisher) {
int queue_id = 0;
while (!__stop) {
while (1) {
if(__stop_zmq_thread && !queues[queue_id].issending)
break;
if (queues[queue_id].issending) {
long long startat=TIMESTAMP();
printf("Publishing...");