From: Mathieu Desnoyers Date: Wed, 16 Jul 2014 21:40:53 +0000 (-0400) Subject: Mutex while updating statedump_pending is not needed X-Git-Tag: v2.5.0~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2932a87f05ceaf44c3a0b51fa6bdecd4b13c113d;p=lttng-ust.git 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 --- 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); }