diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-02 04:54:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-02 04:54:21 +0000 |
commit | f32c76a2668cdbee36f1c6515693b41428f865e7 (patch) | |
tree | 20a1bebec983543fb38b5809a75228ff1136a4a7 /eval.c | |
parent | 1a9a0e7d98bd17964128b321d4dcfa18f0b05ed5 (diff) | |
download | ruby-f32c76a2668cdbee36f1c6515693b41428f865e7.tar.gz |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -6768,12 +6768,14 @@ rb_thread_ready(th) } static void -rb_thread_remove() +rb_thread_remove(th) + rb_thread_t th; { - rb_thread_ready(curr_thread); - curr_thread->status = THREAD_KILLED; - curr_thread->prev->next = curr_thread->next; - curr_thread->next->prev = curr_thread->prev; + if (th->status == THREAD_KILLED) return; + rb_thread_ready(th); + th->status = THREAD_KILLED; + th->prev->next = th->next; + th->next->prev = th->prev; } static int @@ -7661,7 +7663,7 @@ rb_thread_start_0(fn, arg, th) } POP_TAG(); status = th->status; - rb_thread_remove(); + rb_thread_remove(th); if (state && status != THREAD_TO_KILL && !NIL_P(ruby_errinfo)) { th->flags |= THREAD_RAISED; if (state == TAG_FATAL) { @@ -8090,7 +8092,8 @@ rb_callcc(self) for (tag=prot_tag; tag; tag=tag->prev) { scope_dup(tag->scope); } - th->prev = th->next = 0; + th->prev = 0; + th->next = curr_thread; if (THREAD_SAVE_CONTEXT(th)) { return th->result; } |