Introduce channel timer lock
[lttng-tools.git] / src / common / consumer-metadata-cache.c
index c6e6c6b164a423b81dace0312ee3c71c9cb3626e..e21fd4c73cb0b8c4b5d8990500c5d1188909a33e 100644 (file)
@@ -203,8 +203,14 @@ 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->timer_lock);
        pthread_mutex_lock(&channel->metadata_cache->lock);
 
        if (cache->rb_pushed >= offset) {
@@ -225,6 +231,7 @@ int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel,
        }
 
        pthread_mutex_unlock(&channel->metadata_cache->lock);
+       pthread_mutex_unlock(&channel->timer_lock);
        pthread_mutex_unlock(&channel->lock);
        pthread_mutex_unlock(&consumer_data.lock);
 
This page took 0.02456 seconds and 4 git commands to generate.