X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=6a0942e4ee1e8db0b193259884cb8526930cebc7;hp=9ec5763c1609cb9e77b92afe135b124e56372b53;hb=3bdc49f3a50993ea65256e539027cfa55fbd16b0;hpb=9b7cbebd7d78c0950c84cd834ce15d3298d997e6 diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 9ec5763c1..6a0942e4e 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1322,6 +1322,7 @@ int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, pthread_mutex_lock(&channel->metadata_cache->lock); ret = consumer_metadata_cache_write(channel, offset, len, version, metadata_str); + pthread_mutex_unlock(&channel->metadata_cache->lock); if (ret < 0) { /* Unable to handle metadata. Notify session daemon. */ ret_code = LTTCOMM_CONSUMERD_ERROR_METADATA; @@ -1330,10 +1331,8 @@ int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, * not have been updated which could create an infinite loop below when * waiting for the metadata cache to be flushed. */ - pthread_mutex_unlock(&channel->metadata_cache->lock); goto end_free; } - pthread_mutex_unlock(&channel->metadata_cache->lock); if (!wait) { goto end_free;