From 2105c9c28126155e453e023e7399ac826db14cba Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 21 Apr 2023 15:36:20 +0200 Subject: [PATCH] Fix dump_suspended_threads --- .../include/pika/schedulers/queue_helpers.hpp | 10 +++++----- .../include/pika/schedulers/thread_queue.hpp | 2 +- libs/pika/schedulers/src/deadlock_detection.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/pika/schedulers/include/pika/schedulers/queue_helpers.hpp b/libs/pika/schedulers/include/pika/schedulers/queue_helpers.hpp index 1f8ba946a..fca0880f2 100644 --- a/libs/pika/schedulers/include/pika/schedulers/queue_helpers.hpp +++ b/libs/pika/schedulers/include/pika/schedulers/queue_helpers.hpp @@ -47,7 +47,7 @@ namespace pika::threads::detail { return false; // attempt to output possibly deadlocked threads occasionally only - if (PIKA_LIKELY((idle_loop_count++ % PIKA_IDLE_LOOP_COUNT_MAX) != 0)) + if (PIKA_LIKELY((idle_loop_count % PIKA_IDLE_LOOP_COUNT_MAX) != 0)) return false; bool result = false; @@ -83,22 +83,22 @@ namespace pika::threads::detail { if (running) { LTM_(warning) - .format("queue({}): {}({:08x}.{:02x}/{:08x})", num_thread, + .format("queue({}): {}({}.{:02x}/{:08x})", num_thread, get_thread_state_name(state), *it, thrd->get_thread_phase(), thrd->get_component_id()) # ifdef PIKA_HAVE_THREAD_PARENT_REFERENCE - .format(" P{:08x}", thrd->get_parent_thread_id()) + .format(" P{}", thrd->get_parent_thread_id()) # endif .format(": {}: {}", thrd->get_description(), thrd->get_lco_description()); } else { LPIKA_CONSOLE_(pika::util::logging::level::warning) - .format("queue({}): {}({:08x}.{:02x}/{:08x})", num_thread, + .format("queue({}): {}({}.{:02x}/{:08x})", num_thread, get_thread_state_name(state), *it, thrd->get_thread_phase(), thrd->get_component_id()) # ifdef PIKA_HAVE_THREAD_PARENT_REFERENCE - .format(" P{:08x}", thrd->get_parent_thread_id()) + .format(" P{}", thrd->get_parent_thread_id()) # endif .format(": {}: {}", thrd->get_description(), thrd->get_lco_description()); } diff --git a/libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp b/libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp index c36ace612..ca5ff9d17 100644 --- a/libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp +++ b/libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp @@ -1068,7 +1068,7 @@ namespace pika::threads::detail { if (get_deadlock_detection_enabled()) { std::lock_guard lk(mtx_); - return detail::dump_suspended_threads( + return pika::threads::detail::dump_suspended_threads( num_thread, thread_map_, idle_loop_count, running); } return false; diff --git a/libs/pika/schedulers/src/deadlock_detection.cpp b/libs/pika/schedulers/src/deadlock_detection.cpp index 69b247ef0..4780a4ea7 100644 --- a/libs/pika/schedulers/src/deadlock_detection.cpp +++ b/libs/pika/schedulers/src/deadlock_detection.cpp @@ -8,7 +8,7 @@ #include #include -namespace pika::threads { +namespace pika::threads::detail { #ifdef PIKA_HAVE_THREAD_DEADLOCK_DETECTION static bool deadlock_detection_enabled = false; @@ -22,4 +22,4 @@ namespace pika::threads { return deadlock_detection_enabled; } #endif -} // namespace pika::threads +} // namespace pika::threads::detail