Fix: thread exit vs futex wait/wakeup race
[lttng-tools.git] / src / bin / lttng-relayd / live.c
index cc88032dc99abac75d8b011d251b4eafe8493b1a..ffec5977e54984d99e72ae83fb2c79f3029481a7 100644 (file)
@@ -654,12 +654,16 @@ void *thread_dispatcher(void *data)
 
        health_code_update();
 
-       while (!CMM_LOAD_SHARED(live_dispatch_thread_exit)) {
+       for (;;) {
                health_code_update();
 
                /* Atomically prepare the queue futex */
                futex_nto1_prepare(&viewer_conn_queue.futex);
 
+               if (CMM_LOAD_SHARED(live_dispatch_thread_exit)) {
+                       break;
+               }
+
                do {
                        health_code_update();
 
This page took 0.023663 seconds and 4 git commands to generate.