summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-19 17:34:02 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-19 17:34:02 (GMT)
commit30c8f9dd83add8b422888e8ff2bafb234696e8e5 (patch)
tree47ac4aa63d39b773e813ee481cc252e7e82cf44a /ruby_atomic.h
parent6e21b611aaa485259545c0ce696b000aaadee5ed (diff)
ruby_atomic.h (ATOMIC_OR): should return previous value
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 789efdc..e2b1c87 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -7,7 +7,7 @@ typedef unsigned int rb_atomic_t;
# 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; /* Anything OK */
# 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))