X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-timer.cpp;fp=src%2Fcommon%2Fconsumer%2Fconsumer-timer.cpp;h=133ec6c0eaaca52d6348241b5ca61e08556eb41c;hp=7f88a9712825de9151c4d082f6951ad11e81db1a;hb=56047f5a23df5c2c583a102b8015bbec5a7da9f1;hpb=66cefebdc240cbae0bc79594305f509b0779fa98 diff --git a/src/common/consumer/consumer-timer.cpp b/src/common/consumer/consumer-timer.cpp index 7f88a9712..133ec6c0e 100644 --- a/src/common/consumer/consumer-timer.cpp +++ b/src/common/consumer/consumer-timer.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -282,23 +283,23 @@ static void live_timer(struct lttng_consumer_local_data *ctx, siginfo_t *si) DBG("Live timer for channel %" PRIu64, channel->key); - rcu_read_lock(); - cds_lfht_for_each_entry_duplicate(ht->ht, - ht->hash_fct(&channel->key, lttng_ht_seed), - ht->match_fct, - &channel->key, - &iter.iter, - stream, - node_channel_id.node) { - ret = check_stream(stream, flush_index); - if (ret < 0) { - goto error_unlock; + lttng::urcu::read_lock_guard read_lock; + cds_lfht_for_each_entry_duplicate(ht->ht, + ht->hash_fct(&channel->key, lttng_ht_seed), + ht->match_fct, + &channel->key, + &iter.iter, + stream, + node_channel_id.node) + { + ret = check_stream(stream, flush_index); + if (ret < 0) { + goto error_unlock; + } } } - error_unlock: - rcu_read_unlock(); error: return; @@ -575,7 +576,7 @@ static int sample_channel_positions(struct lttng_consumer_channel *channel, *_total_consumed = 0; - rcu_read_lock(); + lttng::urcu::read_lock_guard read_lock; cds_lfht_for_each_entry_duplicate(ht->ht, ht->hash_fct(&channel->key, lttng_ht_seed), @@ -633,7 +634,6 @@ static int sample_channel_positions(struct lttng_consumer_channel *channel, *_highest_use = high; *_lowest_use = low; end: - rcu_read_unlock(); if (empty_channel) { ret = -1; }