From 75841340b29c7abcdc1b728ae5fd2ee20104eac4 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 10 Feb 2009 11:00:25 +0000 Subject: 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_6@22203 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 a6ff6c572e..785f0fb4c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 10 19:57:43 2009 Nobuyoshi Nakada + + * eval.c (load_lock): makes circular require deadlock. + [ruby-core:19821] + Tue Feb 10 19:13:08 2009 Nobuyoshi Nakada * eval.c (rb_feature_p): returns found feature name if loading. diff --git a/eval.c b/eval.c index 93d08619ba..8e037f6334 100644 --- a/eval.c +++ b/eval.c @@ -1441,6 +1441,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)); @@ -7121,8 +7123,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; } @@ -11103,8 +11106,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 894a08b6ff..26dd21a384 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-10" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20090210 -#define RUBY_PATCHLEVEL 326 +#define RUBY_PATCHLEVEL 327 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit v1.2.3