Skip to content

Commit

Permalink
Merge commit 'd50397b372e8f0a4cf473591a13b1305a8278b06' of github.com…
Browse files Browse the repository at this point in the history
…:ponylang/ponyc into support-openssl1.1-simple-travis

Test PR "Don't suspend schedulers if terminating and reset
steal_attempts on wake" ponylang#2447
  • Loading branch information
winksaville committed Dec 25, 2017
2 parents df76a48 + d50397b commit 76577fa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/libponyrt/sched/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ static pony_actor_t* steal(scheduler_t* sched)
{
// if we're the highest active scheduler thread
// and there are more active schedulers than the minimum requested
// and we're not terminating
if ((sched == &scheduler[current_active_scheduler_count - 1])
&& (current_active_scheduler_count > min_scheduler_count) &&
!atomic_exchange_explicit(&scheduler_count_changing, true,
&& (current_active_scheduler_count > min_scheduler_count)
&& (!sched->terminate)
&& !atomic_exchange_explicit(&scheduler_count_changing, true,
memory_order_acquire))
{
// let sched 0 know we're suspending
Expand Down Expand Up @@ -459,6 +461,10 @@ static pony_actor_t* steal(scheduler_t* sched)

// dtrace resume notification
DTRACE1(THREAD_RESUME, (uintptr_t)sched);

// reset steal_attempts so we try to steal from all other schedulers
// prior to suspending again
steal_attempts = 0;
}
else if(!sched->asio_noisy)
{
Expand Down

0 comments on commit 76577fa

Please sign in to comment.