From fb72e453f9e141f182a542dc03b6d95267a3737f Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 25 Jun 2011 14:28:56 +0000 Subject: * thread.c (sleep_forever): now Kernel#sleep don't wakeup by signal handler execution. [Bug #4072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index e76b5ed99b..d99c2d6df5 100644 --- a/thread.c +++ b/thread.c @@ -834,8 +834,9 @@ static void sleep_forever(rb_thread_t *th, int deadlockable) { enum rb_thread_status prev_status = th->status; + enum rb_thread_status status = deadlockable ? THREAD_STOPPED_FOREVER : THREAD_STOPPED; - th->status = deadlockable ? THREAD_STOPPED_FOREVER : THREAD_STOPPED; + th->status = status; do { if (deadlockable) { th->vm->sleeper++; @@ -846,7 +847,7 @@ sleep_forever(rb_thread_t *th, int deadlockable) th->vm->sleeper--; } RUBY_VM_CHECK_INTS(); - } while (th->status == THREAD_STOPPED_FOREVER); + } while (th->status == status); th->status = prev_status; } -- cgit v1.2.3