From: Jérémie Galarneau Date: Fri, 26 Jul 2024 20:41:58 +0000 (+0000) Subject: sessiond: lttng-syscall.cpp: iterate on lfht using lfht_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7f8d6233ea6f62a0cded31c5ee367ff184ae0add;p=lttng-tools.git sessiond: lttng-syscall.cpp: iterate on lfht using lfht_iteration_adapter Change-Id: Ib4439701c48b64b2244b346c86c7b1abb55503c4 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/lttng-syscall.cpp b/src/bin/lttng-sessiond/lttng-syscall.cpp index 598574e65..a89a3bff4 100644 --- a/src/bin/lttng-sessiond/lttng-syscall.cpp +++ b/src/bin/lttng-sessiond/lttng-syscall.cpp @@ -108,25 +108,18 @@ error_ioctl: */ static void destroy_syscall_ht(struct lttng_ht *ht) { - struct lttng_ht_iter iter; - struct syscall *ksyscall; - DBG3("Destroying syscall hash table."); if (!ht) { return; } - { - const lttng::urcu::read_lock_guard read_lock; - - cds_lfht_for_each_entry (ht->ht, &iter.iter, ksyscall, node.node) { - int ret; - - ret = lttng_ht_del(ht, &iter); - LTTNG_ASSERT(!ret); - delete ksyscall; - } + for (auto *ksyscall : lttng::urcu::lfht_iteration_adapter(*ht->ht)) { + const auto ret = cds_lfht_del(ht->ht, &ksyscall->node.node); + LTTNG_ASSERT(!ret); + delete ksyscall; } lttng_ht_destroy(ht);