From 2932a87f05ceaf44c3a0b51fa6bdecd4b13c113d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 16 Jul 2014 17:40:53 -0400 Subject: [PATCH] Mutex while updating statedump_pending is not needed Take care of coverity warning ** CID 1226392: Data race condition (MISSING_LOCK) /liblttng-ust/lttng-ust-comm.c: 1704 in lttng_ust_sockinfo_session_enabled() It's not that the lock is missing, it's that we don't need to hold the lock when doing the other modification. Signed-off-by: Mathieu Desnoyers --- liblttng-ust/lttng-ust-comm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 3a3e1d28..3df2adc6 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -518,8 +518,8 @@ void handle_pending_statedump(struct sock_info *sock_info) int ctor_passed = sock_info->constructor_sem_posted; if (ctor_passed && sock_info->statedump_pending) { - pthread_mutex_lock(&ust_fork_mutex); sock_info->statedump_pending = 0; + pthread_mutex_lock(&ust_fork_mutex); lttng_handle_pending_statedump(sock_info); pthread_mutex_unlock(&ust_fork_mutex); } -- 2.34.1