[前][次][番号順一覧][スレッド一覧]

ruby-changes:22339

From: shirosaki <ko1@a...>
Date: Sat, 28 Jan 2012 09:51:51 +0900 (JST)
Subject: [ruby-changes:22339] shirosaki:r34388 (trunk): * thread_win32.c (rb_w32_wait_events_blocking): use

shirosaki	2012-01-28 09:51:36 +0900 (Sat, 28 Jan 2012)

  New Revision: 34388

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34388

  Log:
    * thread_win32.c (rb_w32_wait_events_blocking): use
      ruby_thread_from_native() instead of GET_THREAD() because
      GET_THREAD() doesn't always return the current thread and
      WaitForMultipleObjects() at rb_w32_read() doesn't return by
      Thread#kill. This fixes TestQueue#test_thr_kill failure on
      Windows.
    
    * thread_win32.c (rb_w32_wait_events): use ruby_thread_from_native()
      instead of GET_THREAD() for consistency with the above change.
    
    * thread_win32.c (rb_w32_sleep): ditto.
    
    * thread_win32.c (rb_w32_Sleep): ditto.
      [ruby-dev:45149] [Bug #5812]

  Modified files:
    trunk/ChangeLog
    trunk/thread_win32.c

Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 34387)
+++ thread_win32.c	(revision 34388)
@@ -231,7 +231,7 @@
 int
 rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout)
 {
-    return w32_wait_events(events, num, timeout, GET_THREAD());
+    return w32_wait_events(events, num, timeout, ruby_thread_from_native());
 }
 
 int
@@ -240,7 +240,7 @@
     int ret;
 
     BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout),
-		    ubf_handle, GET_THREAD());
+		    ubf_handle, ruby_thread_from_native());
     return ret;
 }
 
@@ -285,7 +285,7 @@
 int
 rb_w32_sleep(unsigned long msec)
 {
-    return w32_wait_events(0, 0, msec, GET_THREAD());
+    return w32_wait_events(0, 0, msec, ruby_thread_from_native());
 }
 
 int WINAPI
@@ -294,7 +294,7 @@
     int ret;
 
     BLOCKING_REGION(ret = rb_w32_sleep(msec),
-		    ubf_handle, GET_THREAD());
+		    ubf_handle, ruby_thread_from_native());
     return ret;
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34387)
+++ ChangeLog	(revision 34388)
@@ -1,3 +1,20 @@
+Sat Jan 28 07:46:03 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
+
+	* thread_win32.c (rb_w32_wait_events_blocking): use
+	  ruby_thread_from_native() instead of GET_THREAD() because
+	  GET_THREAD() doesn't always return the current thread and
+	  WaitForMultipleObjects() at rb_w32_read() doesn't return by
+	  Thread#kill. This fixes TestQueue#test_thr_kill failure on
+	  Windows.
+
+	* thread_win32.c (rb_w32_wait_events): use ruby_thread_from_native()
+	  instead of GET_THREAD() for consistency with the above change.
+
+	* thread_win32.c (rb_w32_sleep): ditto.
+
+	* thread_win32.c (rb_w32_Sleep): ditto.
+	  [ruby-dev:45149] [Bug #5812]
+
 Sat Jan 28 07:28:48 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
 
 	* test/zlib/test_zlib.rb (TestZlibGzipReader#test_reader_wrap): set

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]