mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.
[ruby-dev:44596] [Bug #5439] * signal.c (ruby_atomic_exchange): no needs to define on the platforms where atomic.h is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5558de40b6
commit
c96c193e1d
3 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
Fri Oct 14 05:58:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.
|
||||
[ruby-dev:44596] [Bug #5439]
|
||||
|
||||
* signal.c (ruby_atomic_exchange): no needs to define on the
|
||||
platforms where atomic.h is available.
|
||||
|
||||
Thu Oct 13 19:29:40 2011 Naohisa Goto <ngotogenome@gmail.com>
|
||||
|
||||
* atomic.h (ATOMIC_*): use atomic_ops(3C) when SunStudio on Solaris.
|
||||
|
|
5
atomic.h
5
atomic.h
|
@ -54,11 +54,12 @@ typedef unsigned int rb_atomic_t;
|
|||
|
||||
#else
|
||||
typedef int rb_atomic_t;
|
||||
#define NEED_RUBY_ATOMIC_EXCHANGE
|
||||
extern rb_atomic_t ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val);
|
||||
|
||||
# define ATOMIC_SET(var, val) (void)((var) = (val))
|
||||
# define ATOMIC_INC(var) (++(var))
|
||||
# define ATOMIC_DEC(var) (--(var))
|
||||
# define ATOMIC_INC(var) ((var)++)
|
||||
# define ATOMIC_DEC(var) ((var)--)
|
||||
# define ATOMIC_OR(var, val) ((var) |= (val))
|
||||
# define ATOMIC_EXCHANGE(var, val) ruby_atomic_exchange(&(var), (val))
|
||||
#endif
|
||||
|
|
2
signal.c
2
signal.c
|
@ -18,7 +18,7 @@
|
|||
#include <errno.h>
|
||||
#include "atomic.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(HAVE_GCC_ATOMIC_BUILTINS)
|
||||
#ifdef NEED_RUBY_ATOMIC_EXCHANGE
|
||||
rb_atomic_t
|
||||
ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue