From aae1eff5f09ab24e5927428b3301f4c4ff993373 Mon Sep 17 00:00:00 2001 From: yugui Date: Wed, 28 Oct 2009 14:15:39 +0000 Subject: 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 --- ChangeLog | 5 +++++ thread.c | 12 ++++++++---- version.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3a986937..8c5a239a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 20 08:39:50 2009 Yukihiro Matsumoto + + * thread.c (rb_thread_terminate_all): do not ignore interrupt when + reaping threads on termination. [ruby-dev:39107] + Thu Aug 20 01:06:48 2009 Yukihiro Matsumoto * dir.c (DEFINE_STRUCT_DIRENT): use union to allocate sufficient diff --git a/thread.c b/thread.c index ecc8f8482..c51499488 100644 --- a/thread.c +++ b/thread.c @@ -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(); } diff --git a/version.h b/version.h index 6c86cf411..ceb66014e 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 298 +#define RUBY_PATCHLEVEL 299 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- cgit