From mboxrd@z Thu Jan 1 00:00:00 1970 From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte) Date: Mon, 18 Sep 2017 18:51:56 -0400 Subject: [lttng-dev] [RFC PATCH v2 03/13] Terminate dispatch thread after reg_apps_thread is terminated In-Reply-To: <20170918225206.17725-1-jonathan.rajotte-julien@efficios.com> References: <20170918225206.17725-1-jonathan.rajotte-julien@efficios.com> Message-ID: <20170918225206.17725-4-jonathan.rajotte-julien@efficios.com> Signed-off-by: Jonathan Rajotte --- src/bin/lttng-sessiond/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 45c0270e..0ca72ec8 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -497,9 +497,6 @@ static void stop_threads(void) ERR("write error on thread quit pipe"); } - /* Dispatch thread */ - CMM_STORE_SHARED(dispatch_thread_exit, 1); - futex_nto1_wake(&ust_cmd_queue.futex); } /* @@ -6306,6 +6303,10 @@ exit_client: retval = -1; } exit_reg_apps: + /* Instruct the dispatch thread to quit */ + CMM_STORE_SHARED(dispatch_thread_exit, 1); + futex_nto1_wake(&ust_cmd_queue.futex); + ret = pthread_join(dispatch_thread, &status); if (ret) { errno = ret; -- 2.11.0