From 494fd237f00f166cf024a51fd04e064fc94e0f82 Mon Sep 17 00:00:00 2001 From: shirosaki Date: Sat, 28 Jan 2012 00:51:36 +0000 Subject: * 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_win32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'thread_win32.c') diff --git a/thread_win32.c b/thread_win32.c index 873d37d7b5..da971e70de 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -231,7 +231,7 @@ static void ubf_handle(void *ptr); 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 @@ rb_w32_wait_events(HANDLE *events, int num, DWORD timeout) 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 @@ w32_create_thread(DWORD stack_size, w32_thread_start_func func, void *val) 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 @@ rb_w32_Sleep(unsigned long msec) int ret; BLOCKING_REGION(ret = rb_w32_sleep(msec), - ubf_handle, GET_THREAD()); + ubf_handle, ruby_thread_from_native()); return ret; } -- cgit v1.2.3