mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
e504a81ff1
commit
bcfc22b10e
6 changed files with 107 additions and 97 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue