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

ruby-changes:35955

From: nobu <ko1@a...>
Date: Mon, 20 Oct 2014 02:34:16 +0900 (JST)
Subject: [ruby-changes:35955] nobu:r48036 (trunk): ruby_atomic.h (ATOMIC_OR): should return previous value

nobu	2014-10-20 02:34:02 +0900 (Mon, 20 Oct 2014)

  New Revision: 48036

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

  Log:
    ruby_atomic.h (ATOMIC_OR): should return previous value

  Modified files:
    trunk/ruby_atomic.h
Index: ruby_atomic.h
===================================================================
--- ruby_atomic.h	(revision 48035)
+++ ruby_atomic.h	(revision 48036)
@@ -7,7 +7,7 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L7
 # define ATOMIC_SET(var, val)  (void)__atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
 # define ATOMIC_INC(var) __atomic_fetch_add(&(var), 1, __ATOMIC_SEQ_CST)
 # define ATOMIC_DEC(var) __atomic_fetch_sub(&(var), 1, __ATOMIC_SEQ_CST)
-# define ATOMIC_OR(var, val) __atomic_or_fetch(&(var), (val), __ATOMIC_SEQ_CST)
+# define ATOMIC_OR(var, val) __atomic_fetch_or(&(var), (val), __ATOMIC_SEQ_CST)
 # define ATOMIC_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
 # define ATOMIC_CAS(var, oldval, newval) \
 ({ __typeof__(oldval) oldvaldup = (oldval); /* oldval should not be modified */ \
@@ -28,7 +28,7 @@ typedef unsigned int rb_atomic_t; /* Any https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L28
 # define ATOMIC_SET(var, val)  (void)__sync_lock_test_and_set(&(var), (val))
 # define ATOMIC_INC(var) __sync_fetch_and_add(&(var), 1)
 # define ATOMIC_DEC(var) __sync_fetch_and_sub(&(var), 1)
-# define ATOMIC_OR(var, val) __sync_or_and_fetch(&(var), (val))
+# define ATOMIC_OR(var, val) __sync_fetch_and_or(&(var), (val))
 # define ATOMIC_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
 # define ATOMIC_CAS(var, oldval, newval) __sync_val_compare_and_swap(&(var), (oldval), (newval))
 

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

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