Fix threads stuck as zombie under M:N

In this case thread_sched_switch0 never returns, so we would never
end up setting finished to true.

Fixes [Bug #20638]
This commit is contained in:
John Hawthorn 2024-11-13 09:51:56 -08:00
parent e194665720
commit 1cf32b2d7f
Notes: git 2024-12-13 21:57:33 +00:00

View File

@ -477,8 +477,8 @@ co_start(struct coroutine_context *from, struct coroutine_context *self)
if (!has_ready_ractor && next_th && !next_th->nt) {
// switch to the next thread
thread_sched_set_lock_owner(sched, NULL);
thread_sched_switch0(th->sched.context, next_th, nt, true);
th->sched.finished = true;
thread_sched_switch0(th->sched.context, next_th, nt, true);
}
else {
// switch to the next Ractor