From: Jérémie Galarneau Date: Tue, 21 Jun 2022 20:21:17 +0000 (-0400) Subject: Fix: ust-consumerd: set `hangup_flush_done` in a locked context X-Git-Tag: v2.12.12~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f4616c0a5a5b95029bd48a8b78e5b4c484b3a548;p=lttng-tools.git Fix: ust-consumerd: set `hangup_flush_done` in a locked context 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 --- diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 83080edde..0ff3ba0f0 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -2427,8 +2427,9 @@ void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream) ustctl_flush_buffer(stream->ustream, 0); 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)