summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-10 11:01:59 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-10 11:01:59 +0000
commit79c3f54d784ea814be8e4163e8b13deff02ff12d (patch)
treeab46fc5508d41048345d861261979a66d974a58e /eval.c
parentd896aedf3d2c5832fd1218fe0b152c552c8e3e06 (diff)
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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 5 insertions, 4 deletions
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;