X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-comm.c;h=f91f8fd9a86685be3337657beed7af3aff393ccb;hb=01be959de2f1879fcd54a47a74ff443e2ef12f90;hp=bd9d0e9c004863e93509d36953733c63975e5162;hpb=b8687c1ead598149bc02a9b68befd0c6f4c4fad6;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index bd9d0e9c..f91f8fd9 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -86,6 +86,8 @@ static int initialized; * * ust_lock nests within the dynamic loader lock (within glibc) because * it is taken within the library constructor. + * + * The ust fd tracker lock nests within the ust_mutex. */ static pthread_mutex_t ust_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -1455,6 +1457,7 @@ void *ust_listener_thread(void *arg) long timeout; lttng_ust_fixup_tls(); + lttng_ust_fd_tracker_register_thread(); /* * If available, add '-ust' to the end of this thread's * process name @@ -2065,6 +2068,7 @@ void ust_before_fork(sigset_t *save_sigset) ust_lock_nocheck(); rcu_bp_before_fork(); + lttng_ust_lock_fd_tracker(); } static void ust_after_fork_common(sigset_t *restore_sigset) @@ -2072,6 +2076,7 @@ static void ust_after_fork_common(sigset_t *restore_sigset) int ret; DBG("process %d", getpid()); + lttng_ust_unlock_fd_tracker(); ust_unlock(); pthread_mutex_unlock(&ust_fork_mutex);