From 013decae26ae07ffeaef655eafffa0475ff491db Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Oct 2005 14:12:04 +0000 Subject: * rubysig.h (CHECK_INTS): prevent signal handler to run during critical section. [ruby-core:04039] * eval.c (load_wait): need not to call rb_thread_schedule() explicitly. [ruby-core:04039] * eval.c (rb_thread_schedule): clear rb_thread_critical. [ruby-core:04039] * st.c (st_free_table): do not call free() but xfree(). [ruby-core:06205] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 940b25654..e1d2c94ca 100644 --- a/eval.c +++ b/eval.c @@ -6864,19 +6864,19 @@ rb_provide(feature) rb_provide_feature(rb_str_new2(feature)); } -static void +static int load_wait(ftptr) char *ftptr; { st_data_t th; - if (!loading_tbl) return; - if (!st_lookup(loading_tbl, (st_data_t)ftptr, &th)) return; - if ((rb_thread_t)th == curr_thread) return; + if (!loading_tbl) return Qfalse; + if (!st_lookup(loading_tbl, (st_data_t)ftptr, &th)) return Qfalse; do { + if ((rb_thread_t)th == curr_thread) return Qtrue; CHECK_INTS; - rb_thread_schedule(); } while (st_lookup(loading_tbl, (st_data_t)ftptr, &th)); + return Qtrue; } /* @@ -7007,8 +7007,7 @@ rb_require_safe(fname, safe) ruby_safe_level = safe; found = search_required(fname, &feature, &path); if (found) { - if (!path) { - load_wait(RSTRING(feature)->ptr); + if (!path || load_wait(RSTRING(path)->ptr)) { result = Qfalse; } else { -- cgit