document consumer_metadata_cache_flushed use of consumer_data.lock
[lttng-tools.git] / src / common / consumer-metadata-cache.c
index 0c20e7fc7cbba6850a3337fc4ebb788d3e5d5f84..4c8a665af0db7aa1d5d8224edcfac96c5fc2fbb2 100644 (file)
@@ -203,7 +203,13 @@ int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel,
 
        cache = channel->metadata_cache;
 
+       /*
+        * XXX This consumer_data.lock should eventually be replaced by
+        * a channel lock. It protects metadata_stream read and endpoint
+        * status check.
+        */
        pthread_mutex_lock(&consumer_data.lock);
+       pthread_mutex_lock(&channel->lock);
        pthread_mutex_lock(&channel->metadata_cache->lock);
 
        if (cache->rb_pushed >= offset) {
@@ -224,6 +230,7 @@ int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel,
        }
 
        pthread_mutex_unlock(&channel->metadata_cache->lock);
+       pthread_mutex_unlock(&channel->lock);
        pthread_mutex_unlock(&consumer_data.lock);
 
        return ret;
This page took 0.023142 seconds and 4 git commands to generate.