if (stream->globally_visible) {
pthread_mutex_lock(&the_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);
+
destroy_close_stream(stream);
/* Update channel's refcount of the stream. */