Skip to content

Commit

Permalink
Need to ensure active scheduler count is > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinhora committed Nov 23, 2024
1 parent caab092 commit abe104c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libponyrt/sched/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ void ponyint_sched_maybe_wakeup_if_all_asleep(int32_t current_scheduler_id)
{
// wait for sleeping threads to wake and update check variable
// to ensure that we have at least one fully awake scheduler thread
while (get_active_scheduler_count_check() == 0)
while (get_active_scheduler_count_check() == 0 && get_active_scheduler_count() > 0)
{
// send signals to all scheduler threads that should be awake
// this is somewhat wasteful if a scheduler thread is already awake
Expand Down

0 comments on commit abe104c

Please sign in to comment.