From 1a7564a0ed8aa82eb3a7002906e34388b677dc58 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 10 Aug 2007 15:01:14 +0000 Subject: * thread.c (thread_start_func_2): not re-raise to main thread if it is joining the current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ thread.c | 9 +++++++-- version.h | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b9188d3a9..60a6388136 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Aug 11 00:01:12 2007 Nobuyoshi Nakada + + * thread.c (thread_start_func_2): not re-raise to main thread if it is + joining the current thread. + Fri Aug 10 23:54:46 2007 Nobuyoshi Nakada * thread.c (thread_create_core): inherit the priority of creating diff --git a/thread.c b/thread.c index 301d67137a..7ff9439cf4 100644 --- a/thread.c +++ b/thread.c @@ -287,6 +287,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s VALUE args = th->first_args; rb_proc_t *proc; rb_thread_t *join_th; + rb_thread_t *main_th; VALUE errinfo = Qnil; th->machine_stack_start = stack_start; @@ -332,9 +333,13 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s thread_debug("thread end: %p\n", th); st_delete_wrap(th->vm->living_threads, th->self); + main_th = th->vm->main_thread; + if (th == main_th) errinfo = Qnil; + /* wake up joinning threads */ join_th = th->join_list_head; while (join_th) { + if (join_th == main_th) errinfo = Qnil; rb_thread_interrupt(join_th); join_th = join_th->join_list_next; } @@ -343,9 +348,9 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s thread_cleanup_func(th); native_mutex_unlock(&th->vm->global_interpreter_lock); - if (!NIL_P(errinfo) && th != th->vm->main_thread) { + if (!NIL_P(errinfo)) { /* exit on main_thread */ - rb_thread_raise(1, &errinfo, th->vm->main_thread); + rb_thread_raise(1, &errinfo, main_th); } return 0; diff --git a/version.h b/version.h index 84938eff8e..4a682b3df5 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-08-10" +#define RUBY_RELEASE_DATE "2007-08-11" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20070810 +#define RUBY_RELEASE_CODE 20070811 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 8 -#define RUBY_RELEASE_DAY 10 +#define RUBY_RELEASE_DAY 11 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- cgit v1.2.3