Fix: thread exit vs futex wait/wakeup race
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index 56efaae3409748ba6134d72de26692aae6689649..9c96af127473a5080807b30df943cd8993e1910e 100644 (file)
@@ -969,12 +969,16 @@ static void *relay_thread_dispatcher(void *data)
 
        health_code_update();
 
-       while (!CMM_LOAD_SHARED(dispatch_thread_exit)) {
+       for (;;) {
                health_code_update();
 
                /* Atomically prepare the queue futex */
                futex_nto1_prepare(&relay_conn_queue.futex);
 
+               if (CMM_LOAD_SHARED(dispatch_thread_exit)) {
+                       break;
+               }
+
                do {
                        health_code_update();
 
This page took 0.023781 seconds and 4 git commands to generate.