diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-17 04:04:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-17 04:04:51 +0000 |
commit | c04d79f8674aba919400e0469bfdd8cf5fc4c5df (patch) | |
tree | e390e096d93a47fecf69d299521deda44966a737 /thread.c | |
parent | 3f01f3b6dbebbaa0117487c28b36b5c71d2eba1b (diff) | |
download | ruby-c04d79f8674aba919400e0469bfdd8cf5fc4c5df.tar.gz |
* 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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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) { |