X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fmain.c;h=81f10b78368c46401085477a51b799f90cf8fb19;hp=0428d33cef82d7f3c18bcff03f2310433808f7bf;hb=26c9d55e1367d3aff6e501b5a1295edd1ccbc210;hpb=6f94560a050962daad560dac2823bd97b0b1bf98 diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 0428d33ce..81f10b783 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -74,6 +74,7 @@ static int thread_quit_pipe[2] = { -1, -1 }; */ static int relay_cmd_pipe[2] = { -1, -1 }; +/* Shared between threads */ static int dispatch_thread_exit; static pthread_t listener_thread; @@ -272,7 +273,7 @@ void stop_threads(void) } /* Dispatch thread */ - dispatch_thread_exit = 1; + CMM_STORE_SHARED(dispatch_thread_exit, 1); futex_nto1_wake(&relay_cmd_queue.futex); } @@ -608,7 +609,7 @@ void *relay_thread_dispatcher(void *data) DBG("[thread] Relay dispatcher started"); - while (!dispatch_thread_exit) { + while (!CMM_LOAD_SHARED(dispatch_thread_exit)) { /* Atomically prepare the queue futex */ futex_nto1_prepare(&relay_cmd_queue.futex);