diff options
Diffstat (limited to 'thread_win32.ci')
-rw-r--r-- | thread_win32.ci | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/thread_win32.ci b/thread_win32.ci index c2a4a286a7..d71040836b 100644 --- a/thread_win32.ci +++ b/thread_win32.ci @@ -122,7 +122,7 @@ w32_wait_events(HANDLE *events, int count, DWORD timeout, rb_thread_t *th) return ret; } -static void ubf_handle(rb_thread_t *th, void *ptr); +static void ubf_handle(void *ptr); #define ubf_select ubf_handle int @@ -136,7 +136,8 @@ 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, 0); + BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout), + ubf_handle, GET_THREAD()); return ret; } @@ -187,7 +188,8 @@ rb_w32_Sleep(unsigned long msec) { int ret; - BLOCKING_REGION(ret = rb_w32_sleep(msec), ubf_handle, 0); + BLOCKING_REGION(ret = rb_w32_sleep(msec), + ubf_handle, GET_THREAD()); return ret; } @@ -208,10 +210,12 @@ native_sleep(rb_thread_t *th, struct timeval *tv) int status = th->status; th->status = THREAD_STOPPED; th->unblock_function = ubf_handle; + th->unblock_function_arg = th; thread_debug("native_sleep start (%d)\n", (int)msec); ret = w32_wait_events(0, 0, msec, th); thread_debug("native_sleep done (%d)\n", ret); th->unblock_function = 0; + th->unblock_function_arg = 0; th->status = status; } GVL_UNLOCK_END(); @@ -465,8 +469,9 @@ native_thread_apply_priority(rb_thread_t *th) } static void -ubf_handle(rb_thread_t *th, void *ptr) +ubf_handle(void *ptr) { + rb_thread_t *th = (rb_thread_t *)ptr; thread_debug("ubf_handle: %p\n", th); w32_set_event(th->native_thread_data.interrupt_event); } |