summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 02:54:17 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 02:54:17 +0000
commit682e86bebc5f118be2defe9ffea8c9106af153f2 (patch)
treea1336e53f2d993ff85de85fd554bb5d62fef5827 /ruby_atomic.h
parentf0680bdee869d37c0b654d0226ae665e6adc934e (diff)
merge revision(s) 52892: [Backport #11775]
* ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of InterlockedCompareExchange64. new value and then old value is the last. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 789efdc4ea..fa01c7d82c 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -81,7 +81,7 @@ rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t new
# define ATOMIC_SIZE_INC(var) InterlockedIncrement64(&(var))
# define ATOMIC_SIZE_DEC(var) InterlockedDecrement64(&(var))
# define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange64(&(var), (val))
-# define ATOMIC_SIZE_CAS(var, oldval, val) InterlockedCompareExchange64(&(var), (oldval), (val))
+# define ATOMIC_SIZE_CAS(var, oldval, newval) InterlockedCompareExchange64(&(var), (newval), (oldval))
# else
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd((LONG *)&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(LONG)(val))