From d9ab8c66f3e1007a28dfe3fd63f844dcd15b16af Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 21 Jun 2022 16:21:17 -0400 Subject: [PATCH] Fix: ust-consumerd: set `hangup_flush_done` in a locked context MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit hangup_flush_done is updated after releasing the stream lock. This doesn't appear to be a problem right now since this attribute is apparently always accessed by the same thread, but it is conceptually sus. Signed-off-by: Jérémie Galarneau Change-Id: I191cb01b02c3d96e19034e0d0e80cb7f8dff2140 --- src/common/ust-consumer/ust-consumer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/ust-consumer/ust-consumer.cpp b/src/common/ust-consumer/ust-consumer.cpp index 0933c33c8..034043444 100644 --- a/src/common/ust-consumer/ust-consumer.cpp +++ b/src/common/ust-consumer/ust-consumer.cpp @@ -2423,8 +2423,9 @@ void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream) stream->quiescent = true; } } - pthread_mutex_unlock(&stream->lock); + stream->hangup_flush_done = 1; + pthread_mutex_unlock(&stream->lock); } void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) -- 2.34.1