- rcu_read_lock();
- cds_lfht_add(state->client_socket_ht,
- hash_client_socket(client->socket),
- &client->client_socket_ht_node);
- cds_lfht_add(state->client_id_ht, hash_client_id(client->id), &client->client_id_ht_node);
- rcu_read_unlock();
+ {
+ lttng::urcu::read_lock_guard read_lock;
+
+ cds_lfht_add(state->client_socket_ht,
+ hash_client_socket(client->socket),
+ &client->client_socket_ht_node);
+ cds_lfht_add(state->client_id_ht,
+ hash_client_id(client->id),
+ &client->client_id_ht_node);
+ }