* 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
This commit is contained in:
parent
3f01f3b6db
commit
c04d79f867
@ -1,3 +1,8 @@
|
|||||||
|
Sat Jul 17 13:04:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* thread.c (rb_thread_wakeup_alive): split from rb_thread_wakeup.
|
||||||
|
merged from r13476. c.f. [ruby-core:31320]
|
||||||
|
|
||||||
Sat Jul 17 10:07:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Jul 17 10:07:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/test/unit.rb: MiniTest::Unit is different class from
|
* lib/test/unit.rb: MiniTest::Unit is different class from
|
||||||
|
@ -333,6 +333,7 @@ void rb_thread_sleep(int);
|
|||||||
void rb_thread_sleep_forever(void);
|
void rb_thread_sleep_forever(void);
|
||||||
VALUE rb_thread_stop(void);
|
VALUE rb_thread_stop(void);
|
||||||
VALUE rb_thread_wakeup(VALUE);
|
VALUE rb_thread_wakeup(VALUE);
|
||||||
|
VALUE rb_thread_wakeup_alive(VALUE);
|
||||||
VALUE rb_thread_run(VALUE);
|
VALUE rb_thread_run(VALUE);
|
||||||
VALUE rb_thread_kill(VALUE);
|
VALUE rb_thread_kill(VALUE);
|
||||||
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
||||||
|
11
thread.c
11
thread.c
@ -1546,12 +1546,21 @@ rb_thread_exit(void)
|
|||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_thread_wakeup(VALUE thread)
|
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;
|
rb_thread_t *th;
|
||||||
GetThreadPtr(thread, th);
|
GetThreadPtr(thread, th);
|
||||||
|
|
||||||
if (th->status == THREAD_KILLED) {
|
if (th->status == THREAD_KILLED) {
|
||||||
rb_raise(rb_eThreadError, "killed thread");
|
return Qnil;
|
||||||
}
|
}
|
||||||
rb_threadptr_ready(th);
|
rb_threadptr_ready(th);
|
||||||
if (th->status != THREAD_TO_KILL) {
|
if (th->status != THREAD_TO_KILL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user