summaryrefslogtreecommitdiff
path: root/thread_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_win32.c')
-rw-r--r--thread_win32.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/thread_win32.c b/thread_win32.c
index ab308905cb..3c6d0e7369 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -210,8 +210,9 @@ int
rb_w32_wait_events(HANDLE *events, int num, DWORD timeout)
{
int ret;
+ rb_thread_t *th = GET_THREAD();
- BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout),
+ BLOCKING_REGION(th, ret = rb_w32_wait_events_blocking(events, num, timeout),
ubf_handle, ruby_thread_from_native(), FALSE);
return ret;
}
@@ -264,8 +265,9 @@ int WINAPI
rb_w32_Sleep(unsigned long msec)
{
int ret;
+ rb_thread_t *th = GET_THREAD();
- BLOCKING_REGION(ret = rb_w32_sleep(msec),
+ BLOCKING_REGION(th, ret = rb_w32_sleep(msec),
ubf_handle, ruby_thread_from_native(), FALSE);
return ret;
}
@@ -276,7 +278,7 @@ native_sleep(rb_thread_t *th, struct timespec *ts)
const volatile DWORD msec = (ts) ?
(DWORD)(ts->tv_sec * 1000 + ts->tv_nsec / 1000000) : INFINITE;
- GVL_UNLOCK_BEGIN();
+ GVL_UNLOCK_BEGIN(th);
{
DWORD ret;
@@ -299,7 +301,7 @@ native_sleep(rb_thread_t *th, struct timespec *ts)
th->unblock.arg = 0;
rb_native_mutex_unlock(&th->interrupt_lock);
}
- GVL_UNLOCK_END();
+ GVL_UNLOCK_END(th);
}
void