Fix: ust-consumerd: set `hangup_flush_done` in a locked context
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Jun 2022 20:21:17 +0000 (16:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 17 Aug 2022 22:00:26 +0000 (18:00 -0400)
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 <jeremie.galarneau@efficios.com>
Change-Id: I191cb01b02c3d96e19034e0d0e80cb7f8dff2140

src/common/ust-consumer/ust-consumer.c

index ba5f6e42211d7df37c28adf941a9e7e726713d18..c6ffb12234428b43b985abe6c38a467dea26fa5f 100644 (file)
@@ -2463,8 +2463,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)
This page took 0.02601 seconds and 4 git commands to generate.