summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-19 14:12:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-19 14:12:04 +0000
commit222ee5ee461a130dff29cbaa6014526e7c2d1df5 (patch)
tree7145fac9656a81aa73ccd6a425d5d55c80ef9753 /eval.c
parentd53ad837dde3b6a29cefa9e209ad2d9af26be5c9 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 {