ruby-changes:5605
From: usa <ko1@a...>
Date: Thu, 12 Jun 2008 22:21:09 +0900 (JST)
Subject: [ruby-changes:5605] Ruby:r17112 (trunk): * thread_win32.c (native_sleep): fixed previous commit.
usa 2008-06-12 22:20:55 +0900 (Thu, 12 Jun 2008)
New Revision: 17112
Modified files:
trunk/ChangeLog
trunk/thread_win32.c
Log:
* thread_win32.c (native_sleep): fixed previous commit.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17112&r2=17111&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/thread_win32.c?r1=17112&r2=17111&diff_format=u
Index: thread_win32.c
===================================================================
--- thread_win32.c (revision 17111)
+++ thread_win32.c (revision 17112)
@@ -147,7 +147,7 @@
int ret;
BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout),
- ubf_handle, GET_THREAD());
+ ubf_handle, GET_THREAD(), 1);
return ret;
}
@@ -199,14 +199,16 @@
int ret;
BLOCKING_REGION(ret = rb_w32_sleep(msec),
- ubf_handle, GET_THREAD());
+ ubf_handle, GET_THREAD(), 1);
return ret;
}
static void
native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
{
+ int prev_status = th->status;
DWORD msec;
+
if (tv) {
msec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
}
@@ -222,10 +224,10 @@
else {
th->status = THREAD_STOPPED;
}
+
GVL_UNLOCK_BEGIN();
{
DWORD ret;
- int status = th->status;
th->unblock.func = ubf_handle;
th->unblock.arg = th;
@@ -243,7 +245,7 @@
th->unblock.arg = 0;
}
GVL_UNLOCK_END();
- th->status = status;
+ th->status = prev_status;
if (!tv && deadlockable) th->vm->sleeper++;
RUBY_VM_CHECK_INTS();
}
Index: ChangeLog
===================================================================
--- ChangeLog (revision 17111)
+++ ChangeLog (revision 17112)
@@ -1,3 +1,7 @@
+Thu Jun 12 22:19:45 2008 NAKAMURA Usaku <usa@r...>
+
+ * thread_win32.c (native_sleep): fixed previous commit.
+
Thu Jun 12 21:59:17 2008 Yusuke Endoh <mame@t...>
* thread.c, vm_core.h, vm.c, thread_pthread.c, thread_win32.c: add
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/