[前][次][番号順一覧][スレッド一覧]

ruby-changes:51075

From: normal <ko1@a...>
Date: Sat, 28 Apr 2018 15:23:47 +0900 (JST)
Subject: [ruby-changes:51075] normal:r63282 (trunk): thread_sync.c: remove "volatile" qualifiers

normal	2018-04-28 15:23:43 +0900 (Sat, 28 Apr 2018)

  New Revision: 63282

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63282

  Log:
    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.

  Modified files:
    trunk/thread_sync.c
Index: thread_sync.c
===================================================================
--- thread_sync.c	(revision 63281)
+++ thread_sync.c	(revision 63282)
@@ -45,7 +45,7 @@ wakeup_all(struct list_head *head) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L45
 /* 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_mute https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L55
 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) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L318
 }
 
 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 https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L330
     }
     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) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]