Skip to content

Commit

Permalink
Small change in scheduling_loop when not running
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Mar 22, 2018
1 parent fa00ffe commit c6011bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hpx/runtime/threads/detail/scheduling_loop.hpp
Expand Up @@ -662,11 +662,12 @@ namespace hpx { namespace threads { namespace detail
{
++idle_loop_count;

if (scheduler.SchedulingPolicy::cleanup_terminated(num_thread, true))
if (!running)
{
// Clean up terminated threads before trying to exit
bool can_exit =
!running &&
scheduler.SchedulingPolicy::cleanup_terminated(
num_thread, true) &&
scheduler.SchedulingPolicy::get_queue_length(
num_thread) == 0;

Expand Down

0 comments on commit c6011bf

Please sign in to comment.