#include <atomic_int_apple.h>
Public Member Functions | |
atomicInt () | |
atomicInt (int value) | |
atomicInt () | |
atomicInt (int value) | |
bool | deref () |
bool | deref () |
int | fetchAndAddAcquire (int valueToAdd) |
int | fetchAndAddAcquire (int valueToAdd) |
operator int () const | |
operator int () const | |
bool | operator! () const |
bool | operator! () const |
bool | operator!= (int value) const |
bool | operator!= (int value) const |
bool | operator< (int value) const |
bool | operator< (int value) const |
atomicInt & | operator= (int value) |
atomicInt & | operator= (int value) |
bool | operator== (int value) const |
bool | operator== (int value) const |
bool | operator> (int value) const |
bool | operator> (int value) const |
bool | ref () |
bool | ref () |
bool | testAndSetOrdered (int expectedValue, int newValue) |
bool | testAndSetOrdered (int expectedValue, int newValue) |
Private Attributes | |
volatile int | _q_value |
mutex | m |
Definition at line 12 of file atomic_int_apple.h.
mt::atomicInt::atomicInt | ( | ) | [inline] |
Definition at line 19 of file atomic_int_apple.h.
mt::atomicInt::atomicInt | ( | int | value | ) | [inline] |
Definition at line 24 of file atomic_int_apple.h.
mt::atomicInt::atomicInt | ( | ) | [inline] |
Definition at line 12 of file atomic_int_generic.h.
mt::atomicInt::atomicInt | ( | int | value | ) | [inline] |
Definition at line 17 of file atomic_int_generic.h.
bool mt::atomicInt::deref | ( | ) | [inline] |
Definition at line 48 of file atomic_int_generic.h.
bool mt::atomicInt::deref | ( | ) | [inline] |
Definition at line 65 of file atomic_int_apple.h.
int mt::atomicInt::fetchAndAddAcquire | ( | int | valueToAdd | ) | [inline] |
Reads the current _q_value of this QAtomicInt and then adds valueToAdd to the current _q_value, returning the original _q_value.
Definition at line 28 of file atomic_int_generic.h.
int mt::atomicInt::fetchAndAddAcquire | ( | int | valueToAdd | ) | [inline] |
Reads the current value of this QAtomicInt and then adds valueToAdd to the current value, returning the original value.
Unfortunately, MacOSX does not provide with fetch-and-add functions, only add-and-fetch. Therefore, we have to simulate them.
Implementation based on SDL: http://lists.libsdl.org/pipermail/commits-libsdl.org/2011-January/003568.html
Definition at line 41 of file atomic_int_apple.h.
mt::atomicInt::operator int | ( | ) | const [inline] |
Definition at line 86 of file atomic_int_generic.h.
mt::atomicInt::operator int | ( | ) | const [inline] |
Definition at line 103 of file atomic_int_apple.h.
bool mt::atomicInt::operator! | ( | ) | const [inline] |
Definition at line 81 of file atomic_int_generic.h.
bool mt::atomicInt::operator! | ( | ) | const [inline] |
Definition at line 98 of file atomic_int_apple.h.
bool mt::atomicInt::operator!= | ( | int | value | ) | const [inline] |
Definition at line 76 of file atomic_int_generic.h.
bool mt::atomicInt::operator!= | ( | int | value | ) | const [inline] |
Definition at line 93 of file atomic_int_apple.h.
bool mt::atomicInt::operator< | ( | int | value | ) | const [inline] |
Definition at line 102 of file atomic_int_generic.h.
bool mt::atomicInt::operator< | ( | int | value | ) | const [inline] |
Definition at line 119 of file atomic_int_apple.h.
atomicInt& mt::atomicInt::operator= | ( | int | value | ) | [inline] |
Definition at line 91 of file atomic_int_generic.h.
atomicInt& mt::atomicInt::operator= | ( | int | value | ) | [inline] |
Definition at line 108 of file atomic_int_apple.h.
bool mt::atomicInt::operator== | ( | int | value | ) | const [inline] |
Definition at line 71 of file atomic_int_generic.h.
bool mt::atomicInt::operator== | ( | int | value | ) | const [inline] |
Definition at line 88 of file atomic_int_apple.h.
bool mt::atomicInt::operator> | ( | int | value | ) | const [inline] |
Definition at line 97 of file atomic_int_generic.h.
bool mt::atomicInt::operator> | ( | int | value | ) | const [inline] |
Definition at line 114 of file atomic_int_apple.h.
bool mt::atomicInt::ref | ( | void | ) | [inline] |
Atomically increments the _q_value of this atomicInt. Returns true if the new _q_value is non-zero, false otherwise.
Definition at line 39 of file atomic_int_generic.h.
bool mt::atomicInt::ref | ( | void | ) | [inline] |
Atomically increments the value of this atomicInt. Returns true if the new value is non-zero, false otherwise.
Definition at line 57 of file atomic_int_apple.h.
bool mt::atomicInt::testAndSetOrdered | ( | int | expectedValue, |
int | newValue | ||
) | [inline] |
Definition at line 60 of file atomic_int_generic.h.
bool mt::atomicInt::testAndSetOrdered | ( | int | expectedValue, |
int | newValue | ||
) | [inline] |
Definition at line 76 of file atomic_int_apple.h.
volatile int mt::atomicInt::_q_value [private] |
Definition at line 16 of file atomic_int_apple.h.
mutex mt::atomicInt::m [private] |
Definition at line 109 of file atomic_int_generic.h.