Ruby
2.5.0dev(2017-10-22revision60238)
|
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_EXCHANGE(var, val) ruby_atomic_size_exchange(&(var), (val)) |
#define | ATOMIC_SIZE_INC(var) ATOMIC_INC(var) |
#define | ATOMIC_SIZE_DEC(var) ATOMIC_DEC(var) |
#define | ATOMIC_SIZE_CAS(var, oldval, val) ATOMIC_CAS(var, oldval, val) |
#define | ATOMIC_PTR_EXCHANGE(var, val) (void *)ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val)) |
#define | ATOMIC_PTR_CAS(var, oldval, val) (void *)ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val)) |
#define | ATOMIC_VALUE_EXCHANGE(var, val) ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val)) |
#define | ATOMIC_VALUE_CAS(var, oldval, val) ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(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) |
#define ATOMIC_CAS | ( | var, | |
oldval, | |||
newval | |||
) | ruby_atomic_compare_and_swap(&(var), (oldval), (newval)) |
Definition at line 132 of file ruby_atomic.h.
Referenced by rb_postponed_job_flush().
#define ATOMIC_DEC | ( | var | ) | ((var)--) |
Definition at line 129 of file ruby_atomic.h.
#define ATOMIC_EXCHANGE | ( | var, | |
val | |||
) | ruby_atomic_exchange(&(var), (val)) |
Definition at line 131 of file ruby_atomic.h.
#define ATOMIC_INC | ( | var | ) | ((var)++) |
Definition at line 128 of file ruby_atomic.h.
Definition at line 130 of file ruby_atomic.h.
#define ATOMIC_PTR_CAS | ( | var, | |
oldval, | |||
val | |||
) | (void *)ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val)) |
Definition at line 191 of file ruby_atomic.h.
#define ATOMIC_PTR_EXCHANGE | ( | var, | |
val | |||
) | (void *)ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val)) |
Definition at line 177 of file ruby_atomic.h.
Referenced by rb_free_tmp_buffer().
Definition at line 127 of file ruby_atomic.h.
Definition at line 134 of file ruby_atomic.h.
#define ATOMIC_SIZE_CAS | ( | var, | |
oldval, | |||
val | |||
) | ATOMIC_CAS(var, oldval, val) |
Definition at line 156 of file ruby_atomic.h.
#define ATOMIC_SIZE_DEC | ( | var | ) | ATOMIC_DEC(var) |
Definition at line 150 of file ruby_atomic.h.
Definition at line 136 of file ruby_atomic.h.
#define ATOMIC_SIZE_INC | ( | var | ) | ATOMIC_INC(var) |
Definition at line 147 of file ruby_atomic.h.
Definition at line 135 of file ruby_atomic.h.
#define ATOMIC_VALUE_CAS | ( | var, | |
oldval, | |||
val | |||
) | ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val)) |
Definition at line 220 of file ruby_atomic.h.
#define ATOMIC_VALUE_EXCHANGE | ( | var, | |
val | |||
) | ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val)) |
Definition at line 206 of file ruby_atomic.h.
Referenced by rb_free_tmp_buffer().
#define NEED_RUBY_ATOMIC_OPS |
Definition at line 121 of file ruby_atomic.h.
typedef int rb_atomic_t |
Definition at line 120 of file ruby_atomic.h.
rb_atomic_t ruby_atomic_compare_and_swap | ( | rb_atomic_t * | ptr, |
rb_atomic_t | cmp, | ||
rb_atomic_t | newval | ||
) |
rb_atomic_t ruby_atomic_exchange | ( | rb_atomic_t * | ptr, |
rb_atomic_t | val | ||
) |