X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-metadata-cache.c;h=4c8a665af0db7aa1d5d8224edcfac96c5fc2fbb2;hb=3eb914c096ff6a91a7d0c4b8bbadb4c85f16aed3;hp=0c20e7fc7cbba6850a3337fc4ebb788d3e5d5f84;hpb=fe81e5c901c1dd23495620c8efd9e1ed6df86c8b;p=lttng-tools.git diff --git a/src/common/consumer-metadata-cache.c b/src/common/consumer-metadata-cache.c index 0c20e7fc7..4c8a665af 100644 --- a/src/common/consumer-metadata-cache.c +++ b/src/common/consumer-metadata-cache.c @@ -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;