summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-08 08:54:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-08 08:54:01 +0000
commit320e99d8dda5eb5fc327fcbe20126cdd7fcd059d (patch)
treeb1fc6d8062eebd46c7b8f4fd67f606c9af8f93c2 /eval.c
parent25be6ce9b5dd2aabad61410068d688250c562189 (diff)
2000-02-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/eval.c b/eval.c
index 068e7e0ad4..d19f41f271 100644
--- a/eval.c
+++ b/eval.c
@@ -7266,21 +7266,21 @@ rb_thread_scope_shared_p()
static VALUE
rb_thread_yield(arg, th)
- int arg;
+ VALUE arg;
thread_t th;
{
scope_dup(ruby_block->scope);
- return rb_yield_0(th->thread, 0, 0, Qfalse);
+ return rb_yield_0(arg, 0, 0, Qfalse);
}
static VALUE
-rb_thread_start(klass)
- VALUE klass;
+rb_thread_start(klass, args)
+ VALUE klass, args;
{
if (!rb_iterator_p()) {
rb_raise(rb_eThreadError, "must be called as iterator");
}
- return rb_thread_create_0(rb_thread_yield, 0, klass);
+ return rb_thread_create_0(rb_thread_yield, args, klass);
}
static VALUE
@@ -7708,9 +7708,9 @@ Init_Thread()
rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
rb_cThread = rb_define_class("Thread", rb_cObject);
- rb_define_singleton_method(rb_cThread, "new", rb_thread_start, 0);
- rb_define_singleton_method(rb_cThread, "start", rb_thread_start, 0);
- rb_define_singleton_method(rb_cThread, "fork", rb_thread_start, 0);
+ rb_define_singleton_method(rb_cThread, "new", rb_thread_start, -2);
+ rb_define_singleton_method(rb_cThread, "start", rb_thread_start, -2);
+ rb_define_singleton_method(rb_cThread, "fork", rb_thread_start, -2);
rb_define_singleton_method(rb_cThread, "stop", rb_thread_stop, 0);
rb_define_singleton_method(rb_cThread, "kill", rb_thread_s_kill, 1);