summaryrefslogtreecommitdiff
path: root/thread_pthread_mn.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2024-11-13 09:51:56 -0800
committerJohn Hawthorn <[email protected]>2024-12-13 13:57:14 -0800
commit1cf32b2d7f2bb0dafce6108ecfc496491b19ad8a (patch)
tree2eb962494a1381db989fcd7a6c7e2b59c5975d11 /thread_pthread_mn.c
parente1946657205fb14583dd3020d60c5236a11fdd9b (diff)
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]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12080
Diffstat (limited to 'thread_pthread_mn.c')
-rw-r--r--thread_pthread_mn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thread_pthread_mn.c b/thread_pthread_mn.c
index 8508dcaf17..b5efb90f28 100644
--- a/thread_pthread_mn.c
+++ b/thread_pthread_mn.c
@@ -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