projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Lock FD tracker across fork
[lttng-ust.git]
/
liblttng-ust
/
lttng-ust-comm.c
diff --git
a/liblttng-ust/lttng-ust-comm.c
b/liblttng-ust/lttng-ust-comm.c
index e392e460cca2dada53036fc622adbc8b3cf87355..47ba36e5c9f1d9f1871c267469049708a7dd1e1e 100644
(file)
--- 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.
*
* 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;
*/
static pthread_mutex_t ust_mutex = PTHREAD_MUTEX_INITIALIZER;
@@
-2065,6
+2067,7
@@
void ust_before_fork(sigset_t *save_sigset)
ust_lock_nocheck();
urcu_bp_before_fork();
ust_lock_nocheck();
urcu_bp_before_fork();
+ lttng_ust_lock_fd_tracker();
}
static void ust_after_fork_common(sigset_t *restore_sigset)
}
static void ust_after_fork_common(sigset_t *restore_sigset)
@@
-2072,6
+2075,7
@@
static void ust_after_fork_common(sigset_t *restore_sigset)
int ret;
DBG("process %d", getpid());
int ret;
DBG("process %d", getpid());
+ lttng_ust_unlock_fd_tracker();
ust_unlock();
pthread_mutex_unlock(&ust_fork_mutex);
ust_unlock();
pthread_mutex_unlock(&ust_fork_mutex);
This page took
0.039632 seconds
and
4
git commands to generate.