aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.h
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 14:14:53 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 14:14:53 +0000
commitbcfc22b10e30771e692f7716a1fec7577373963e (patch)
tree5e8442fc328f3e322069070a678141837e1e9c9b /thread_pthread.h
parente504a81ff11c8611f06d54a23b355fed90b356ab (diff)
downloadruby-bcfc22b10e30771e692f7716a1fec7577373963e.tar.gz
* 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
Diffstat (limited to 'thread_pthread.h')
-rw-r--r--thread_pthread.h14
1 files changed, 10 insertions, 4 deletions
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 <semaphore.h>
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 */