From bcfc22b10e30771e692f7716a1fec7577373963e Mon Sep 17 00:00:00 2001 From: kosaki Date: Mon, 13 Jun 2011 14:14:53 +0000 Subject: * thread_pthread.c: rewrite GVL completely. * thread_win32.c: ditto. * thread_pthread.h: ditto. * vm_core.h: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'thread_pthread.h') diff --git a/thread_pthread.h b/thread_pthread.h index 97a26e0e80..781712c3f6 100644 --- a/thread_pthread.h +++ b/thread_pthread.h @@ -35,11 +35,17 @@ typedef struct native_thread_data_struct { #include typedef struct rb_global_vm_lock_struct { + /* fast path */ + unsigned long acquired; pthread_mutex_t lock; - struct rb_thread_struct * volatile waiting_threads; - struct rb_thread_struct *waiting_last_thread; - int waiting; - int volatile acquired; + + /* slow path */ + unsigned long waiting; + rb_thread_cond_t cond; + + /* yield */ + rb_thread_cond_t switch_cond; + unsigned long need_yield; } rb_global_vm_lock_t; #endif /* RUBY_THREAD_PTHREAD_H */ -- cgit v1.2.1