summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index 940b256545..e1d2c94ca2 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 {