consumer: introduce channel lock
[lttng-tools.git] / src / common / consumer-metadata-cache.c
index 0c20e7fc7cbba6850a3337fc4ebb788d3e5d5f84..c6e6c6b164a423b81dace0312ee3c71c9cb3626e 100644 (file)
@@ -204,6 +204,7 @@ int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel,
        cache = channel->metadata_cache;
 
        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 +225,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.025746 seconds and 5 git commands to generate.