diff --git a/libs/pika/synchronization/src/detail/condition_variable.cpp b/libs/pika/synchronization/src/detail/condition_variable.cpp index 82b1ec5f5..5f967ba9c 100644 --- a/libs/pika/synchronization/src/detail/condition_variable.cpp +++ b/libs/pika/synchronization/src/detail/condition_variable.cpp @@ -100,6 +100,7 @@ namespace pika::detail { // swap the list queue_type queue; queue.swap(queue_); + lock.unlock(); if (!queue.empty()) { @@ -117,6 +118,7 @@ namespace pika::detail { if (PIKA_UNLIKELY(!ctx)) { + lock.lock(); prepend_entries(lock, queue); lock.unlock(); @@ -125,8 +127,6 @@ namespace pika::detail { return; } - [[maybe_unused]] util::ignore_while_checking il(&lock); - ctx.resume(); } while (!queue.empty()); diff --git a/libs/pika/threading_base/src/set_thread_state.cpp b/libs/pika/threading_base/src/set_thread_state.cpp index 07b27be9a..134fb08e6 100644 --- a/libs/pika/threading_base/src/set_thread_state.cpp +++ b/libs/pika/threading_base/src/set_thread_state.cpp @@ -133,7 +133,7 @@ namespace pika::threads::detail { else { pika::execution::this_thread::detail::yield_k( - k % 16, "pika::threads::detail::set_thread_state"); + k, "pika::threads::detail::set_thread_state"); ++k; // NOLINTNEXTLINE(bugprone-branch-clone)