Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@17500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 8724448ed5eacc86f903f85b6eb87895714b8569 1 parent d2c3d9d
@unak unak authored
Showing with 10 additions and 0 deletions.
  1. +6 −0 ChangeLog
  2. +4 −0 thread_win32.c
View
6 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.
View
4 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;
Please sign in to comment.
Something went wrong with that request. Please try again.