diff mbox series

[RFC,v2,03/13] Terminate dispatch thread after reg_apps_thread is terminated

Message ID 20170918225206.17725-4-jonathan.rajotte-julien@efficios.com
State Superseded, archived
Delegated to: Jérémie Galarneau
Headers show
Series Sessiond teardown overhaul | expand

Commit Message

Jonathan Rajotte Sept. 18, 2017, 10:51 p.m. UTC
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/bin/lttng-sessiond/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jérémie Galarneau Dec. 14, 2017, 1:55 a.m. UTC | #1
No objection to the code, but please add a description and comment.

Jérémie

On 18 September 2017 at 18:51, Jonathan Rajotte
<jonathan.rajotte-julien at efficios.com> wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
>  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
>
diff mbox series

Patch

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;