summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-17 04:04:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-17 04:04:51 +0000
commitc04d79f8674aba919400e0469bfdd8cf5fc4c5df (patch)
treee390e096d93a47fecf69d299521deda44966a737 /thread.c
parent3f01f3b6dbebbaa0117487c28b36b5c71d2eba1b (diff)
* thread.c (rb_thread_wakeup_alive): split from rb_thread_wakeup.
merged from r13476. c.f. [ruby-core:31320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index be580ac98b..de60b4d226 100644
--- a/thread.c
+++ b/thread.c
@@ -1547,11 +1547,20 @@ rb_thread_exit(void)
VALUE
rb_thread_wakeup(VALUE thread)
{
+ if (!RTEST(rb_thread_wakeup_alive(thread))) {
+ rb_raise(rb_eThreadError, "killed thread");
+ }
+ return thread;
+}
+
+VALUE
+rb_thread_wakeup_alive(VALUE thread)
+{
rb_thread_t *th;
GetThreadPtr(thread, th);
if (th->status == THREAD_KILLED) {
- rb_raise(rb_eThreadError, "killed thread");
+ return Qnil;
}
rb_threadptr_ready(th);
if (th->status != THREAD_TO_KILL) {