summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-21 07:48:29 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-21 07:48:29 +0000
commit9dfaf295986785b1618c207a6292342eb6828a01 (patch)
tree2ca4aef7df0970f09bbe23c9edbbc09032e208b6
parent653b6a578f5aec890846bf07ffa1b22960d33eba (diff)
downloadruby-9dfaf295986785b1618c207a6292342eb6828a01.tar.gz
ruby-9dfaf295986785b1618c207a6292342eb6828a01.tar.xz
ruby-9dfaf295986785b1618c207a6292342eb6828a01.zip
* thread_win32.c (native_sleep): must block reentrance when accessing
th->unblock. fixed [ruby-core:17341], reported by Bill Kelly <billk at cts.com> git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--thread_win32.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d5ecea0d..69165a8b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jun 21 16:46:09 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread_win32.c (native_sleep): must block reentrance when accessing
+ th->unblock.
+ fixed [ruby-core:17341], reported by Bill Kelly <billk at cts.com>
+
Sat Jun 21 16:29:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (call_args2, open_args): removed.
diff --git a/thread_win32.c b/thread_win32.c
index 993f5f271..8365ff256 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -229,8 +229,10 @@ native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
{
DWORD ret;
+ native_mutex_lock(&th->interrupt_lock);
th->unblock.func = ubf_handle;
th->unblock.arg = th;
+ native_mutex_unlock(&th->interrupt_lock);
if (RUBY_VM_INTERRUPTED(th)) {
/* interrupted. return immediate */
@@ -241,8 +243,10 @@ native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
thread_debug("native_sleep done (%lu)\n", ret);
}
+ native_mutex_lock(&th->interrupt_lock);
th->unblock.func = 0;
th->unblock.arg = 0;
+ native_mutex_unlock(&th->interrupt_lock);
}
GVL_UNLOCK_END();
th->status = prev_status;