From: Jérémie Galarneau Date: Mon, 7 Mar 2022 20:12:35 +0000 (-0500) Subject: Build fix: use of mutable keyword in C file X-Git-Tag: v2.13.5~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fc23b856c4e402da8c6ee07866d34cd8a67ef233;p=lttng-tools.git Build fix: use of mutable keyword in C file 4045de280 is a backport of a fix against a C++ file in which `mutable` is used to allow an ASSERT_LOCKED check. Remove the use of mutable and make session_has_ongoing_rotation() non-const. Signed-off-by: Jérémie Galarneau Change-Id: Id6317ad5c271f08701c9545827f75010f5e2e55d --- diff --git a/src/bin/lttng-relayd/session.c b/src/bin/lttng-relayd/session.c index d6909fce1..8a68c11b3 100644 --- a/src/bin/lttng-relayd/session.c +++ b/src/bin/lttng-relayd/session.c @@ -486,8 +486,6 @@ bool session_has_ongoing_rotation(const struct relay_session *session) struct lttng_ht_iter iter; struct relay_session *iterated_session; - ASSERT_LOCKED(session->lock); - if (!session->id_sessiond.is_set) { /* * The peer that created this session is too old to diff --git a/src/bin/lttng-relayd/session.h b/src/bin/lttng-relayd/session.h index 8029dcd8e..6bc006a4b 100644 --- a/src/bin/lttng-relayd/session.h +++ b/src/bin/lttng-relayd/session.h @@ -73,7 +73,7 @@ struct relay_session { struct urcu_ref ref; - mutable pthread_mutex_t lock; + pthread_mutex_t lock; /* major/minor version used for this session. */ uint32_t major; @@ -156,7 +156,7 @@ void session_put(struct relay_session *session); int session_close(struct relay_session *session); int session_abort(struct relay_session *session); -bool session_has_ongoing_rotation(const struct relay_session *session); +bool session_has_ongoing_rotation(struct relay_session *session); void print_sessions(void);