consumer_metadata_cache_flushed makes use of the metadata stream's
ust_metadata_pushed attribute without locking while it is updated by
commit_one_metadata_packet() which holds the metadata stream lock.
This is marked as a clean-up since the attribute appears to always be
accessed while the metadata cache lock is held. However this is a
_channel_ attribute and the stream and channel lifetimes do not match,
making the locking assumptions conceptually dubious.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
pthread_mutex_lock(&channel->lock);
}
pthread_mutex_lock(&channel->timer_lock);
- pthread_mutex_lock(&channel->metadata_cache->lock);
-
metadata_stream = channel->metadata_stream;
+ pthread_mutex_lock(&metadata_stream->lock);
+ pthread_mutex_lock(&channel->metadata_cache->lock);
if (!metadata_stream) {
/*
}
pthread_mutex_unlock(&channel->metadata_cache->lock);
+ pthread_mutex_unlock(&metadata_stream->lock);
pthread_mutex_unlock(&channel->timer_lock);
if (!timer) {
pthread_mutex_unlock(&channel->lock);