From fc23b856c4e402da8c6ee07866d34cd8a67ef233 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 7 Mar 2022 15:12:35 -0500 Subject: [PATCH] Build fix: use of mutable keyword in C file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-relayd/session.c | 2 -- src/bin/lttng-relayd/session.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) 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); -- 2.34.1