summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 311bd5f097..d269feae6d 100644
--- a/eval.c
+++ b/eval.c
@@ -8866,13 +8866,14 @@ rb_thread_wait_other_threads()
static void
rb_thread_cleanup()
{
- rb_thread_t th;
+ rb_thread_t curr, th;
- while (curr_thread->status == THREAD_KILLED) {
- curr_thread = curr_thread->prev;
+ curr = curr_thread;
+ while (curr->status == THREAD_KILLED) {
+ curr = curr_thread->prev;
}
- FOREACH_THREAD(th) {
+ FOREACH_THREAD_FROM(curr, th) {
if (th->status != THREAD_KILLED) {
rb_thread_ready(th);
th->gid = 0;
@@ -8883,7 +8884,7 @@ rb_thread_cleanup()
}
}
}
- END_FOREACH(th);
+ END_FOREACH_FROM(curr, th);
}
int rb_thread_critical;