Skip to content

Commit

Permalink
Merge #659
Browse files Browse the repository at this point in the history
659: Fix `dump_suspended_threads` r=msimberg a=msimberg

Follow-up to #658.

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
  • Loading branch information
bors[bot] and msimberg authored Apr 24, 2023
2 parents 3c44093 + 2105c9c commit 42d9a51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions libs/pika/schedulers/include/pika/schedulers/queue_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ namespace pika::threads::detail {
if (get_deadlock_detection_enabled())
{
std::lock_guard<mutex_type> lk(mtx_);
return detail::dump_suspended_threads(
return pika::threads::detail::dump_suspended_threads(
num_thread, thread_map_, idle_loop_count, running);
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions libs/pika/schedulers/src/deadlock_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <pika/config.hpp>
#include <pika/schedulers/deadlock_detection.hpp>

namespace pika::threads {
namespace pika::threads::detail {
#ifdef PIKA_HAVE_THREAD_DEADLOCK_DETECTION
static bool deadlock_detection_enabled = false;

Expand All @@ -22,4 +22,4 @@ namespace pika::threads {
return deadlock_detection_enabled;
}
#endif
} // namespace pika::threads
} // namespace pika::threads::detail

0 comments on commit 42d9a51

Please sign in to comment.