X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Fmain.c;h=69d5f6b7f1b10feb51463f86aba65f9b1386cbda;hp=c3e1623419700308aa711f68ccce6c5dbb4bd4f1;hb=eb9cb8b758bc88e9117fd0726646a7c9ae4f7984;hpb=b5541356f517dba006af9f676df8131dcb68f132 diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index c3e162341..69d5f6b7f 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -105,6 +105,8 @@ static pthread_mutex_t kconsumerd_pid_mutex; /* Mutex to control kconsumerd pid * This points to the tracing session list containing the session count and a * mutex lock. The lock MUST be taken if you iterate over the list. The lock * MUST NOT be taken if you call a public function in session.c. + * + * The lock is nested inside the structure: session_list_ptr->lock. */ static struct ltt_session_list *session_list_ptr; @@ -839,6 +841,7 @@ static int start_kconsumerd(void) pthread_mutex_lock(&kconsumerd_pid_mutex); if (kconsumerd_pid != 0) { + pthread_mutex_unlock(&kconsumerd_pid_mutex); goto end; } @@ -864,7 +867,6 @@ static int start_kconsumerd(void) } end: - pthread_mutex_unlock(&kconsumerd_pid_mutex); return 0; error: