From 0861165bdcef50bb504526153d87d8e0a7be0140 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 3 Mar 1998 02:39:35 +0000 Subject: *** empty log message *** git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'eval.c') 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); -- cgit v1.2.3