Skip to content

Commit

Permalink
Allow set_thread_state to yield again if other thread is active
Browse files Browse the repository at this point in the history
This change was only introduced to never yield while holding a lock in
condition_variable::notify_all. However, that was relaxed to not hold a
lock while resuming threads so we can again allow yielding in
set_thread_state.
  • Loading branch information
msimberg committed May 17, 2023
1 parent 9252490 commit a46a7ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/pika/threading_base/src/set_thread_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a46a7ce

Please sign in to comment.