зеркало из https://github.com/github/ruby.git
* atomic.h (ATOMIC_*): use atomic_ops(3C) when SunStudio on Solaris.
[ruby-dev:44596] [Bug #5439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
123645aab6
Коммит
5558de40b6
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 13 19:29:40 2011 Naohisa Goto <ngotogenome@gmail.com>
|
||||
|
||||
* atomic.h (ATOMIC_*): use atomic_ops(3C) when SunStudio on Solaris.
|
||||
[ruby-dev:44596] [Bug #5439]
|
||||
|
||||
Thu Oct 13 18:13:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* atomic.h(ATOMIC_SET): add cast to void to prevent misuse.
|
||||
|
|
10
atomic.h
10
atomic.h
|
@ -42,6 +42,16 @@ typedef unsigned int rb_atomic_t; /* Anything OK */
|
|||
# define ATOMIC_OR(var, val) __sync_or_and_fetch(&(var), (val))
|
||||
# define ATOMIC_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
#include <atomic.h>
|
||||
typedef unsigned int rb_atomic_t;
|
||||
|
||||
# define ATOMIC_SET(var, val) (void)atomic_swap_uint(&(var), (val))
|
||||
# define ATOMIC_INC(var) atomic_inc_uint(&(var))
|
||||
# define ATOMIC_DEC(var) atomic_dec_uint(&(var))
|
||||
# define ATOMIC_OR(var, val) atomic_or_uint(&(var), (val))
|
||||
# define ATOMIC_EXCHANGE(var, val) atomic_swap_uint(&(var), (val))
|
||||
|
||||
#else
|
||||
typedef int rb_atomic_t;
|
||||
extern rb_atomic_t ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val);
|
||||
|
|
Загрузка…
Ссылка в новой задаче