Fix: thread exit vs futex wait/wakeup race
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 8527ad04c8afdbbab57d4890694c68ee2f2571a6..50eead010a3e2e72b053f4c899a49a2a02f86042 100644 (file)
@@ -1916,12 +1916,16 @@ static void *thread_dispatch_ust_registration(void *data)
 
        DBG("[thread] Dispatch UST command started");
 
-       while (!CMM_LOAD_SHARED(dispatch_thread_exit)) {
+       for (;;) {
                health_code_update();
 
                /* Atomically prepare the queue futex */
                futex_nto1_prepare(&ust_cmd_queue.futex);
 
+               if (CMM_LOAD_SHARED(dispatch_thread_exit)) {
+                       break;
+               }
+
                do {
                        struct ust_app *app = NULL;
                        ust_cmd = NULL;
This page took 0.023938 seconds and 4 git commands to generate.