From afd1a64cd6ee73e69744a09242cc079b3f1f5170 Mon Sep 17 00:00:00 2001 From: kosaki Date: Mon, 13 Jun 2011 15:06:30 +0000 Subject: * 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 --- thread_win32.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'thread_win32.c') diff --git a/thread_win32.c b/thread_win32.c index da335e88ff..668d94b6c7 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -105,6 +105,15 @@ gvl_release(rb_vm_t *vm) ReleaseMutex(vm->gvl.lock); } +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) { -- cgit v1.2.3