Fix: ust-consumer: metadata cache lock not taken when sampling max offset
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index 6a0942e4ee1e8db0b193259884cb8526930cebc7..be00191749ba5e81e03fef925f1c95ee3bb2ee96 100644 (file)
@@ -3063,7 +3063,9 @@ int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
                uint64_t contiguous, pushed;
 
                /* Ease our life a bit. */
+               pthread_mutex_lock(&stream->chan->metadata_cache->lock);
                contiguous = stream->chan->metadata_cache->max_offset;
+               pthread_mutex_unlock(&stream->chan->metadata_cache->lock);
                pushed = stream->ust_metadata_pushed;
 
                /*
This page took 0.023618 seconds and 4 git commands to generate.