diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 06:23:43 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 06:23:43 +0000 |
commit | b6e2851431a12edff6259e876818fee8f4506acb (patch) | |
tree | ce70bf8110461569b5a90c19e950063cd650d5c9 | |
parent | 0d77b73db7851dc53520504d047b5d4ea078e28e (diff) |
thread_sync.c: remove "volatile" qualifiers
I may store ->ec in rb_mutex_t instead of ->th to support green
thread. For now, "volatile" is useless for thread-safety
anyways and we're not dealing with *jmp or signals with mutex.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | thread_sync.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/thread_sync.c b/thread_sync.c index 5b6ff80d56..7bdef32682 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -45,7 +45,7 @@ wakeup_all(struct list_head *head) /* Mutex */ typedef struct rb_mutex_struct { - struct rb_thread_struct volatile *th; + rb_thread_t *th; struct rb_mutex_struct *next_mutex; struct list_head waitq; /* protected by GVL */ } rb_mutex_t; @@ -55,7 +55,7 @@ static void rb_mutex_abandon_all(rb_mutex_t *mutexes); static void rb_mutex_abandon_keeping_mutexes(rb_thread_t *th); static void rb_mutex_abandon_locking_mutex(rb_thread_t *th); #endif -static const char* rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th); +static const char* rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t *th); /* * Document-class: Mutex @@ -318,7 +318,7 @@ rb_mutex_owned_p(VALUE self) } static const char * -rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th) +rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t *th) { const char *err = NULL; @@ -330,7 +330,7 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th) } else { struct sync_waiter *cur = 0, *next = 0; - rb_mutex_t *volatile *th_mutex = &th->keeping_mutexes; + rb_mutex_t **th_mutex = &th->keeping_mutexes; mutex->th = 0; list_for_each_safe(&mutex->waitq, cur, next, node) { |