* 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
This commit is contained in:
nagachika 2011-06-25 14:28:56 +00:00
Родитель 1a196574c4
Коммит fb72e453f9
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sat Jun 25 23:23:14 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* thread.c (sleep_forever): now Kernel#sleep don't wakeup by
signal handler execution. [Bug #4072]
Sat Jun 25 23:14:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com> Sat Jun 25 23:14:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* thread.c (rb_threadptr_check_signal): remove unnecessary th->status * thread.c (rb_threadptr_check_signal): remove unnecessary th->status

Просмотреть файл

@ -834,8 +834,9 @@ static void
sleep_forever(rb_thread_t *th, int deadlockable) sleep_forever(rb_thread_t *th, int deadlockable)
{ {
enum rb_thread_status prev_status = th->status; 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 { do {
if (deadlockable) { if (deadlockable) {
th->vm->sleeper++; th->vm->sleeper++;
@ -846,7 +847,7 @@ sleep_forever(rb_thread_t *th, int deadlockable)
th->vm->sleeper--; th->vm->sleeper--;
} }
RUBY_VM_CHECK_INTS(); RUBY_VM_CHECK_INTS();
} while (th->status == THREAD_STOPPED_FOREVER); } while (th->status == status);
th->status = prev_status; th->status = prev_status;
} }