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.12.9~13 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9ed81174fc70c6f5c7f423d0513074c690bc8ab5;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 6b98431d1..95bdf3ad0 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);