aboutsummaryrefslogtreecommitdiffstats
path: root/thread_win32.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 15:06:30 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 15:06:30 +0000
commitafd1a64cd6ee73e69744a09242cc079b3f1f5170 (patch)
tree60c0e44dab0d9b01e9f3fb3f44dc346def9da66b /thread_win32.c
parent57ed1e9d75360713c3d5d75c4cbb05ea48c8b025 (diff)
downloadruby-afd1a64cd6ee73e69744a09242cc079b3f1f5170.tar.gz
* thread.c (rb_thread_schedule_rec): call gvl_yield() unconditionally.
* thread_pthread.c: remove HAVE_GVL_YIELD macro. * thread_win32.c (gvl_yield): new. this fallback logic was moved from rb_thread_schedule_rec(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.c')
-rw-r--r--thread_win32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/thread_win32.c b/thread_win32.c
index da335e88ff..668d94b6c7 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -106,6 +106,15 @@ gvl_release(rb_vm_t *vm)
}
static void
+gvl_yield(rb_vm_t *vm, rb_thread_t *th)
+{
+ gvl_release(th->vm);
+ native_thread_yield();
+ gvl_acquire(vm, th);
+}
+
+
+static void
gvl_atfork(rb_vm_t *vm)
{
rb_bug("gvl_atfork() is called on win32");