mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ruby_atomic.h: duplicate code
* ruby_atomic.h (ATOMIC_SIZE_CAS): remove duplicate code as ATOMIC_CAS(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c06f12031e
commit
b8434daf6b
1 changed files with 0 additions and 4 deletions
|
@ -16,10 +16,6 @@ typedef unsigned int rb_atomic_t;
|
|||
|
||||
# define ATOMIC_SIZE_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_SEQ_CST)
|
||||
# define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)
|
||||
# define ATOMIC_SIZE_CAS(var, oldval, newval) \
|
||||
({ size_t oldvaldup = (oldval); \
|
||||
__atomic_compare_exchange_n(&(var), &oldvaldup, (newval), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
|
||||
oldvaldup; })
|
||||
|
||||
#elif defined HAVE_GCC_SYNC_BUILTINS
|
||||
/* @shyouhei hack to support atomic operations in case of gcc. Gcc
|
||||
|
|
Loading…
Add table
Reference in a new issue