diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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 { |