summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-25 14:21:16 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-25 14:21:16 +0000
commit1a196574c4bd7867cd30f48d057680e5a1ab3364 (patch)
tree2a9088652f9346ff35d9fd75e82cb072cb8d8ce1 /thread.c
parenteae5081790fc71df5c72fb743e7b8ae914e85c16 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 1 insertions, 4 deletions
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;
}
}