diff --git a/ChangeLog b/ChangeLog index cd5d22551e..7998c897ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Jun 25 23:14:47 2011 CHIKANAGA Tomoyuki + + * thread.c (rb_threadptr_check_signal): remove unnecessary th->status + backup. fix race condition which may results unexpected main thread's + status transition. see #4072 + Fri Jun 24 19:57:30 2011 Hiroshi Nakamura * lib/webrick/httprequest.rb (setup_forwarded_info): Parsing request diff --git a/thread.c b/thread.c index 9324371d16..e76b5ed99b 100644 --- a/thread.c +++ b/thread.c @@ -2953,13 +2953,10 @@ rb_threadptr_check_signal(rb_thread_t *mth) /* mth must be main_thread */ if (!mth->exec_signal && (sig = rb_get_next_signal()) > 0) { - enum rb_thread_status prev_status = mth->status; thread_debug("main_thread: %s, sig: %d\n", - thread_status_name(prev_status), sig); + thread_status_name(mth->status), sig); mth->exec_signal = sig; - if (mth->status != THREAD_KILLED) mth->status = THREAD_RUNNABLE; rb_threadptr_interrupt(mth); - mth->status = prev_status; } }