X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-consumer.cpp;h=8bcc246121346b239c651ac66c8a23b8aab926a3;hb=56047f5a23df5c2c583a102b8015bbec5a7da9f1;hp=6b646fb941c767b1e4bdbd546619625f6c1186f3;hpb=28ab034a2c3582d07d3423d2d746731f87d3969f;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-consumer.cpp b/src/bin/lttng-sessiond/ust-consumer.cpp index 6b646fb94..8bcc24612 100644 --- a/src/bin/lttng-sessiond/ust-consumer.cpp +++ b/src/bin/lttng-sessiond/ust-consumer.cpp @@ -42,7 +42,7 @@ static int ask_channel_creation(struct ust_app_session *ua_sess, int ret, output; uint32_t chan_id; uint64_t key, chan_reg_key; - char *pathname = NULL; + char *pathname = nullptr; struct lttcomm_consumer_msg msg; char shm_path[PATH_MAX] = ""; char root_shm_path[PATH_MAX] = ""; @@ -266,12 +266,12 @@ int ust_consumer_get_channel(struct consumer_socket *socket, struct ust_app_chan } /* Next, get all streams. */ - while (1) { + while (true) { struct ust_app_stream *stream; /* Create UST stream */ stream = ust_app_alloc_stream(); - if (stream == NULL) { + if (stream == nullptr) { ret = -ENOMEM; goto error; } @@ -462,7 +462,7 @@ int ust_consumer_metadata_request(struct consumer_socket *socket) LTTNG_ASSERT(socket); - rcu_read_lock(); + lttng::urcu::read_lock_guard read_lock; health_code_update(); /* Wait for a metadata request */ @@ -520,6 +520,5 @@ int ust_consumer_metadata_request(struct consumer_socket *socket) ret = 0; end: - rcu_read_unlock(); return ret; }