From 79c3f54d784ea814be8e4163e8b13deff02ff12d Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 10 Feb 2009 11:01:59 +0000 Subject: [PATCH] merge revision(s) 20225: * eval.c (load_lock): makes circular require deadlock. [ruby-core:19821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ eval.c | 9 +++++---- version.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7445675c82..1db4ae77df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 10 20:00:52 2009 Nobuyoshi Nakada + + * eval.c (load_lock): makes circular require deadlock. + [ruby-core:19821] + Tue Feb 10 19:40:58 2009 Nobuyoshi Nakada * eval.c (rb_feature_p): returns found feature name if loading. diff --git a/eval.c b/eval.c index 3b579a7616..bd90b4041f 100644 --- a/eval.c +++ b/eval.c @@ -1440,6 +1440,8 @@ eval_node(self, node) int ruby_in_eval; +static int rb_thread_join _((rb_thread_t, double)); + static void rb_thread_cleanup _((void)); static void rb_thread_wait_other_threads _((void)); @@ -7241,8 +7243,9 @@ load_lock(ftptr) return (char *)ftptr; } do { - if ((rb_thread_t)th == curr_thread) return 0; - CHECK_INTS; + rb_thread_t owner = (rb_thread_t)th; + if (owner == curr_thread) return 0; + rb_thread_join(owner->thread, -1.0); } while (st_lookup(loading_tbl, (st_data_t)ftptr, &th)); return 0; } @@ -11386,8 +11389,6 @@ rb_thread_select(max, read, write, except, timeout) return curr_thread->select_value; } -static int rb_thread_join _((rb_thread_t, double)); - static int rb_thread_join(th, limit) rb_thread_t th; diff --git a/version.h b/version.h index f90a6e61a9..700af17ad4 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-10" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20090210 -#define RUBY_PATCHLEVEL 112 +#define RUBY_PATCHLEVEL 113 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8