File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/plugins/output/json/src Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 4242#ifndef JSON_FILE_H
4343#define JSON_FILE_H
4444
45+ #include < atomic>
4546#include < string>
4647#include < ctime>
4748#include < cstdio>
@@ -72,7 +73,7 @@ class File : public Output {
7273 ipx_ctx_t *ctx; /* *< Plugin instance context */
7374 pthread_t thread; /* *< Thread */
7475 pthread_rwlock_t rwlock; /* *< Data rwlock */
75- bool stop; /* *< Stop flag for termination */
76+ std::atomic< bool > stop; /* *< Stop flag for termination */
7677
7778 unsigned int window_size; /* *< Size of a time window */
7879 time_t window_time; /* *< Current time window */
Original file line number Diff line number Diff line change 4040#ifndef JSON_SERVER_H
4141#define JSON_SERVER_H
4242
43+ #include < atomic>
4344#include < string>
4445#include < vector>
4546#include < pthread.h>
@@ -78,10 +79,10 @@ class Server : public Output
7879 ipx_ctx_t *ctx; /* *< Instance context (for log only ) */
7980 pthread_t thread; /* *< Thread */
8081 pthread_mutex_t mutex; /* *< Mutex for the array */
81- bool stop; /* *< Stop flag for terminating */
82+ std::atomic< bool > stop; /* *< Stop flag for terminating */
8283
8384 int socket_fd; /* *< Server socket */
84- bool new_clients_ready; /* *< New clients flag */
85+ std::atomic< bool > new_clients_ready; /* *< New clients flag */
8586 std::vector<client_t > new_clients; /* *< Array of new clients */
8687 } acceptor_t ;
8788
You can’t perform that action at this time.
0 commit comments