diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | thread.c | 9 | ||||
-rw-r--r-- | version.h | 6 |
3 files changed, 15 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Sat Aug 11 00:01:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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 <nobu@ruby-lang.org> * thread.c (thread_create_core): inherit the priority of creating @@ -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; @@ -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[]; |