Don't suspend schedulers if terminating and reset steal_attempts on wake (#2447)
Don't suspend schedulers if terminating and reset steal_attempts on wake (#2447)

Prior to this commit, a scheduler thread could potentially suspend even
if it was supposed to be terminating. This commit makes it so that it
only goes down the suspend path if the thread is not terminating.

Additionally, we now set `steal_attempts = 0` on waking from a suspend
to ensure that the scheduler thread will try to steal from all other
threads prior to suspending again.
ponylang/ponyc,Theodus/ponyc,Theodus/ponyc,CausalityLtd/ponyc,kulibali/ponyc,jemc/ponyc,dipinhora/ponyc,ponylang/ponyc,sgebbie/ponyc,cquinn/ponyc,Theodus/ponyc,sgebbie/ponyc,Theodus/ponyc,CausalityLtd/ponyc,cquinn/ponyc,kulibali/ponyc,sgebbie/ponyc,Praetonus/ponyc,sgebbie/ponyc,ponylang/ponyc,cquinn/ponyc,cquinn/ponyc,jemc/ponyc,sgebbie/ponyc,dipinhora/ponyc,Theodus/ponyc,dipinhora/ponyc,kulibali/ponyc,jemc/ponyc,Praetonus/ponyc,Praetonus/ponyc,kulibali/ponyc,CausalityLtd/ponyc,Praetonus/ponyc