summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-03 02:39:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-03 02:39:35 +0000
commit0861165bdcef50bb504526153d87d8e0a7be0140 (patch)
tree41d899ef727f1b9adbb8efdb349eb4853eb2db62 /eval.c
parent6bb525282cdd551bd240557daf019378ee211952 (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/eval.c b/eval.c
index 275e59baad..bc928bb715 100644
--- a/eval.c
+++ b/eval.c
@@ -5463,22 +5463,15 @@ thread_pass()
}
static VALUE
-thread_stop_method(thread)
- VALUE thread;
+thread_stop()
{
- thread_t th = thread_check(thread);
-
thread_critical = 0;
- th->status = THREAD_STOPPED;
+ curr_thread->status = THREAD_STOPPED;
+ if (curr_thread == curr_thread->next) {
+ Raise(eThreadError, "stopping only thread");
+ }
thread_schedule();
- return thread;
-}
-
-static VALUE
-thread_stop()
-{
- thread_stop_method(curr_thread->thread);
return Qnil;
}
@@ -5887,7 +5880,6 @@ Init_Thread()
rb_define_method(cThread, "run", thread_run, 0);
rb_define_method(cThread, "wakeup", thread_wakeup, 0);
- rb_define_method(cThread, "stop", thread_stop_method, 0);
rb_define_method(cThread, "exit", thread_kill, 0);
rb_define_method(cThread, "value", thread_value, 0);
rb_define_method(cThread, "status", thread_status, 0);