#include <SYS_AtomicInt.h>
Public Member Functions | |
| SYS_AtomicInt32 (int32 value=0) | |
| int32 | exchange (int32 val) |
| int32 | exchangeAdd (int32 val) |
| int32 | add (int32 val) |
| Atomically adds val to myValue, returning the new value of myValue. | |
| void | maximum (int32 val) |
| Atomically set myValue to the maximum of val and myValue. | |
| int32 | compare_swap (int32 expected, int32 desired) |
| void | store (int32 val, SYS_MemoryOrder order=SYS_MEMORY_ORDER_SEQ_CST) |
| int32 | load (SYS_MemoryOrder order=SYS_MEMORY_ORDER_SEQ_CST) const |
| operator int32 () const | |
| Atomically retrieve value. Same as calling load(). | |
Definition at line 25 of file SYS_AtomicInt.h.
| SYS_AtomicInt32::SYS_AtomicInt32 | ( | int32 | value = 0 |
) | [inline, explicit] |
Definition at line 28 of file SYS_AtomicInt.h.
Atomically adds val to myValue, returning the new value of myValue.
Definition at line 42 of file SYS_AtomicIntImpl.h.
Atomically compares (myValue == expected), and if true, replaces myValue with desired. Returns prior myValue.
Definition at line 59 of file SYS_AtomicIntImpl.h.
Note that to use any of these three methods you must include SYS_AtomicIntImpl. Do *not* include that file in a .h file as it brings in windows.h! Atomically assigns val to myValue, returning the prior value of myValue.
Atomically assigns val to myValue, returning the prior value of myValue.
Definition at line 27 of file SYS_AtomicIntImpl.h.
Atomically adds val to myValue, returning the prior value of myValue.
Definition at line 35 of file SYS_AtomicIntImpl.h.
| SYS_ATOMIC_INLINE int32 SYS_AtomicInt32::load | ( | SYS_MemoryOrder | order = SYS_MEMORY_ORDER_SEQ_CST |
) | const [inline] |
This shouldn't be a problem unless somebody needs a volatile instance of SYS_AtomicInt32.
Definition at line 83 of file SYS_AtomicIntImpl.h.
| SYS_ATOMIC_INLINE void SYS_AtomicInt32::maximum | ( | int32 | val | ) | [inline] |
Atomically set myValue to the maximum of val and myValue.
Definition at line 48 of file SYS_AtomicIntImpl.h.
| SYS_ATOMIC_INLINE SYS_AtomicInt32::operator int32 | ( | ) | const |
Atomically retrieve value. Same as calling load().
Definition at line 89 of file SYS_AtomicIntImpl.h.
| SYS_ATOMIC_INLINE void SYS_AtomicInt32::store | ( | int32 | val, | |
| SYS_MemoryOrder | order = SYS_MEMORY_ORDER_SEQ_CST | |||
| ) | [inline] |
This shouldn't be a problem unless somebody needs a volatile instance of SYS_AtomicInt32.
Definition at line 71 of file SYS_AtomicIntImpl.h.
1.5.9