Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Typedefs | Functions
ruby_atomic.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros
#define | NEED_RUBY_ATOMIC_OPS
#define | ATOMIC_SET(var, val) (void)((var) = (val))
#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))
#define | ATOMIC_CAS(var, oldval, newval) ruby_atomic_compare_and_swap(&(var), (oldval), (newval))
#define | ATOMIC_SIZE_ADD(var, val) (void)((var) += (val))
#define | ATOMIC_SIZE_SUB(var, val) (void)((var) -= (val))
#define | ATOMIC_SIZE_INC(var) ((var)++)
#define | ATOMIC_SIZE_DEC(var) ((var)--)
#define | ATOMIC_SIZE_EXCHANGE(var, val) atomic_size_exchange(&(var), (val))

## Typedefs
typedef int | rb_atomic_t

## Functions
rb_atomic_t | ruby_atomic_exchange (rb_atomic_t *ptr, rb_atomic_t val)
rb_atomic_t | ruby_atomic_compare_and_swap (rb_atomic_t *ptr, rb_atomic_t cmp, rb_atomic_t newval)
static size_t | atomic_size_exchange (size_t *ptr, size_t val)

## Macro Definition Documentation

#define ATOMIC_CAS | ( |  | var,
|  |  | oldval,
|  |  | newval
| ) |  | ruby_atomic_compare_and_swap(&(var), (oldval), (newval))

Definition at line 105 of file ruby_atomic.h.

Referenced by rb_threadptr_execute_interrupts(), and rb_update_max_fd().

#define ATOMIC_DEC | ( |  | var | ) | ((var)--)

Definition at line 102 of file ruby_atomic.h.

Referenced by rb_get_next_signal().

#define ATOMIC_EXCHANGE | ( |  | var,
|  |  | val
| ) |  | ruby_atomic_exchange(&(var), (val))

Definition at line 104 of file ruby_atomic.h.

Referenced by rb_gc_finalize_deferred(), and rb_objspace_call_finalizer().

#define ATOMIC_INC | ( |  | var | ) | ((var)++)

Definition at line 101 of file ruby_atomic.h.

Referenced by sighandler().

#define ATOMIC_OR | ( |  | var,
|  |  | val
| ) |  | ((var) |= (val))

Definition at line 103 of file ruby_atomic.h.

#define ATOMIC_SET | ( |  | var,
|  |  | val
| ) |  | (void)((var) = (val))

Definition at line 100 of file ruby_atomic.h.

Referenced by rb_gc_finalize_deferred(), and rb_objspace_call_finalizer().

#define ATOMIC_SIZE_ADD | ( |  | var,
|  |  | val
| ) |  | (void)((var) += (val))

Definition at line 107 of file ruby_atomic.h.

Referenced by vm_malloc_fixup(), and vm_xrealloc().

#define ATOMIC_SIZE_DEC | ( |  | var | ) | ((var)--)

Definition at line 110 of file ruby_atomic.h.

Referenced by vm_xfree().

#define ATOMIC_SIZE_EXCHANGE | ( |  | var,
|  |  | val
| ) |  | atomic_size_exchange(&(var), (val))

Definition at line 111 of file ruby_atomic.h.

Referenced by after_gc_sweep().

#define ATOMIC_SIZE_INC | ( |  | var | ) | ((var)++)

Definition at line 109 of file ruby_atomic.h.

Referenced by vm_malloc_fixup().

#define ATOMIC_SIZE_SUB | ( |  | var,
|  |  | val
| ) |  | (void)((var) -= (val))

Definition at line 108 of file ruby_atomic.h.

Referenced by vm_xfree().

#define NEED_RUBY_ATOMIC_OPS

Definition at line 94 of file ruby_atomic.h.

## Typedef Documentation

typedef int rb_atomic_t

Definition at line 93 of file ruby_atomic.h.

## Function Documentation

static size_t atomic_size_exchange | ( | size_t * | ptr,
|  | size_t | val
| ) |  |
| inline static

Definition at line 113 of file ruby_atomic.h.

References ptr, and val.

rb_atomic_t ruby_atomic_compare_and_swap | ( | rb_atomic_t * | ptr,
|  | rb_atomic_t | cmp,
|  | rb_atomic_t | newval
| ) |  |

Definition at line 36 of file signal.c.

References ptr.

rb_atomic_t ruby_atomic_exchange | ( | rb_atomic_t * | ptr,
|  | rb_atomic_t | val
| ) |  |

Definition at line 28 of file signal.c.

References ptr, and val.