summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 049f78c998..4098b83382 100644
--- a/eval.c
+++ b/eval.c
@@ -1441,8 +1441,6 @@ 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));
@@ -11130,8 +11128,11 @@ rb_thread_select(max, read, write, except, timeout)
return curr_thread->select_value;
}
+static int rb_thread_join0 _((rb_thread_t, double));
+int rb_thread_join _((VALUE, double));
+
static int
-rb_thread_join(th, limit)
+rb_thread_join0(th, limit)
rb_thread_t th;
double limit;
{
@@ -11173,6 +11174,15 @@ rb_thread_join(th, limit)
return Qtrue;
}
+int
+rb_thread_join(thread, limit)
+ VALUE thread;
+ double limit;
+{
+ if (limit < 0) limit = DELAY_INFTY;
+ return rb_thread_join0(rb_thread_check(thread), limit);
+}
+
/*
* call-seq:
@@ -11222,11 +11232,10 @@ rb_thread_join_m(argc, argv, thread)
{
VALUE limit;
double delay = DELAY_INFTY;
- rb_thread_t th = rb_thread_check(thread);
rb_scan_args(argc, argv, "01", &limit);
if (!NIL_P(limit)) delay = rb_num2dbl(limit);
- if (!rb_thread_join(th, delay))
+ if (!rb_thread_join0(rb_thread_check(thread), delay))
return Qnil;
return thread;
}
@@ -12269,7 +12278,7 @@ rb_thread_value(thread)
{
rb_thread_t th = rb_thread_check(thread);
- while (!rb_thread_join(th, DELAY_INFTY));
+ while (!rb_thread_join0(th, DELAY_INFTY));
return th->result;
}