X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.c;h=bfec997eec808019f28283aa2a42f6fdd7baf913;hb=69018d12995a4fb76285cd77e9ad013ac81c0b27;hp=4dec3e80964a4d07212734a18d719209c4a3abc9;hpb=8dbd7d838dc2276e5a25057c76c2e219e1d2661b;p=lttng-tools.git diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 4dec3e809..bfec997ee 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -47,6 +47,7 @@ #include #include #include +#include struct lttng_consumer_global_data consumer_data = { .stream_count = 0, @@ -2052,6 +2053,10 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream, pthread_mutex_lock(&consumer_data.lock); pthread_mutex_lock(&stream->chan->lock); + if (stream->chan->metadata_cache) { + /* Only applicable to userspace consumers. */ + pthread_mutex_lock(&stream->chan->metadata_cache->lock); + } pthread_mutex_lock(&stream->lock); /* Remove any reference to that stream. */ @@ -2077,6 +2082,9 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream, stream->chan->metadata_stream = NULL; pthread_mutex_unlock(&stream->lock); + if (stream->chan->metadata_cache) { + pthread_mutex_unlock(&stream->chan->metadata_cache->lock); + } pthread_mutex_unlock(&stream->chan->lock); pthread_mutex_unlock(&consumer_data.lock);