diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-28 14:15:39 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-28 14:15:39 +0000 |
| commit | aae1eff5f09ab24e5927428b3301f4c4ff993373 (patch) | |
| tree | 48616fed93919322d97159db9103d0bc2848225f /thread.c | |
| parent | b3ecdf9a0f4331bc86d49dafeb15313d8edc0d3c (diff) | |
merges r24591 from trunk into ruby_1_9_1.
--
* thread.c (rb_thread_terminate_all): do not ignore interrupt when
reaping threads on termination. [ruby-dev:39107]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
| -rw-r--r-- | thread.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -298,6 +298,9 @@ rb_thread_terminate_all(void) { rb_thread_t *th = GET_THREAD(); /* main thread */ rb_vm_t *vm = th->vm; + VALUE einfo = vm->main_thread->errinfo; + int state; + if (vm->main_thread != th) { rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)", (void *)vm->main_thread, (void *)th); @@ -313,13 +316,14 @@ rb_thread_terminate_all(void) while (!rb_thread_alone()) { PUSH_TAG(); - if (EXEC_TAG() == 0) { + if ((state = EXEC_TAG()) == 0) { rb_thread_schedule(); } - else { - /* ignore exception */ - } POP_TAG(); + if (state && einfo != vm->main_thread->errinfo && + RUBY_VM_SET_INTERRUPT(vm->main_thread)) { + break; + } } rb_thread_stop_timer_thread(); } |
