consumer: introduce channel lock
[lttng-tools.git] / src / common / consumer-stream.c
index 723ec829f80095ff17bd3e5996540d01d754072a..717e0a7351a49461e4702c872fc91914b8efaffe 100644 (file)
@@ -280,6 +280,7 @@ void consumer_stream_destroy(struct lttng_consumer_stream *stream,
                 */
                if (stream->globally_visible) {
                        pthread_mutex_lock(&consumer_data.lock);
+                       pthread_mutex_lock(&stream->chan->lock);
                        pthread_mutex_lock(&stream->lock);
                        /* Remove every reference of the stream in the consumer. */
                        consumer_stream_delete(stream, ht);
@@ -293,6 +294,7 @@ void consumer_stream_destroy(struct lttng_consumer_stream *stream,
                        consumer_data.need_update = 1;
 
                        pthread_mutex_unlock(&stream->lock);
+                       pthread_mutex_unlock(&stream->chan->lock);
                        pthread_mutex_unlock(&consumer_data.lock);
                } else {
                        /*
This page took 0.023209 seconds and 4 git commands to generate.