X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=6cf85d96a75b0afa69994886d9a94d91a7faaa29;hb=7f12ef5d1b1de751b90c2e88fa331692a998ed70;hp=6e99a7f52d0d24ac1473db3f1c2bf12880a8df78;hpb=75d83e506938a3e673ad19bb11838ee88e977e72;p=lttng-tools.git diff --git a/src/common/consumer.c b/src/common/consumer.c index 6e99a7f52..6cf85d96a 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -551,6 +551,7 @@ static int add_stream(struct lttng_consumer_stream *stream, pthread_mutex_lock(&consumer_data.lock); pthread_mutex_lock(&stream->chan->lock); + pthread_mutex_lock(&stream->chan->timer_lock); pthread_mutex_lock(&stream->lock); rcu_read_lock(); @@ -588,6 +589,7 @@ static int add_stream(struct lttng_consumer_stream *stream, rcu_read_unlock(); pthread_mutex_unlock(&stream->lock); + pthread_mutex_unlock(&stream->chan->timer_lock); pthread_mutex_unlock(&stream->chan->lock); pthread_mutex_unlock(&consumer_data.lock); @@ -838,6 +840,7 @@ struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key, channel->tracefile_count = tracefile_count; channel->monitor = monitor; pthread_mutex_init(&channel->lock, NULL); + pthread_mutex_init(&channel->timer_lock, NULL); /* * In monitor mode, the streams associated with the channel will be put in @@ -884,6 +887,7 @@ int consumer_add_channel(struct lttng_consumer_channel *channel, pthread_mutex_lock(&consumer_data.lock); pthread_mutex_lock(&channel->lock); + pthread_mutex_lock(&channel->timer_lock); rcu_read_lock(); lttng_ht_lookup(consumer_data.channel_ht, &channel->key, &iter); @@ -900,6 +904,7 @@ int consumer_add_channel(struct lttng_consumer_channel *channel, end: rcu_read_unlock(); + pthread_mutex_unlock(&channel->timer_lock); pthread_mutex_unlock(&channel->lock); pthread_mutex_unlock(&consumer_data.lock); @@ -1956,8 +1961,8 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream, end: /* * Nullify the stream reference so it is not used after deletion. The - * consumer data lock MUST be acquired before being able to check for a - * NULL pointer value. + * channel lock MUST be acquired before being able to check for + * a NULL pointer value. */ stream->chan->metadata_stream = NULL; @@ -1991,6 +1996,7 @@ static int add_metadata_stream(struct lttng_consumer_stream *stream, pthread_mutex_lock(&consumer_data.lock); pthread_mutex_lock(&stream->chan->lock); + pthread_mutex_lock(&stream->chan->timer_lock); pthread_mutex_lock(&stream->lock); /* @@ -2037,6 +2043,7 @@ static int add_metadata_stream(struct lttng_consumer_stream *stream, pthread_mutex_unlock(&stream->lock); pthread_mutex_unlock(&stream->chan->lock); + pthread_mutex_unlock(&stream->chan->timer_lock); pthread_mutex_unlock(&consumer_data.lock); return ret; }