X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=3e9814fdb7ea20f50f8156d476c564b362e5e651;hb=6791112142b503d8f92cca737cc37215b1057568;hp=f3ea024dd6330e93cf0d38b0a28a78d1daa650b4;hpb=54b393a43bf05fc453c609a8c3532250733e3759;p=lttng-tools.git diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index f3ea024dd..3e9814fdb 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1327,6 +1327,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; @@ -1335,10 +1336,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;