45 #include <QtCore/qglobal.h> 46 #include <QtCore/qbasicatomic.h> 61 this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
68 this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
75 (void) QBasicAtomicInt::operator=(value);
81 (void) QBasicAtomicInt::operator=(other);
88 bool operator!()
const;
91 static bool isReferenceCountingNative();
92 static bool isReferenceCountingWaitFree();
97 static bool isTestAndSetNative();
98 static bool isTestAndSetWaitFree();
100 bool testAndSetRelaxed(
int expectedValue,
int newValue);
101 bool testAndSetAcquire(
int expectedValue,
int newValue);
102 bool testAndSetRelease(
int expectedValue,
int newValue);
103 bool testAndSetOrdered(
int expectedValue,
int newValue);
105 static bool isFetchAndStoreNative();
106 static bool isFetchAndStoreWaitFree();
108 int fetchAndStoreRelaxed(
int newValue);
109 int fetchAndStoreAcquire(
int newValue);
110 int fetchAndStoreRelease(
int newValue);
111 int fetchAndStoreOrdered(
int newValue);
113 static bool isFetchAndAddNative();
114 static bool isFetchAndAddWaitFree();
116 int fetchAndAddRelaxed(
int valueToAdd);
117 int fetchAndAddAcquire(
int valueToAdd);
118 int fetchAndAddRelease(
int valueToAdd);
119 int fetchAndAddOrdered(
int valueToAdd);
124 template <
typename T>
130 #ifdef QT_ARCH_PARISC 131 this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
137 #ifdef QT_ARCH_PARISC 138 this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
159 operator T *()
const;
194 template <
typename T>
213 template <
typename T>
QAtomicPointer< T > & operator=(const QAtomicPointer< T > &other)
Assigns other to this QAtomicPointer and returns a reference to this QAtomicPointer.
void qAtomicDetach(T *&d)
This is a helper for the detach method of implicitly shared classes.
bool operator==(T *value) const
Returns true if the value is equal to the value in this QAtomicPointer; otherwise returns false...
QAtomicPointer(T *value=0)
Constructs a QAtomicPointer with the given value.
#define QT_END_NAMESPACE
This macro expands to.
static bool isFetchAndStoreNative()
Returns true if fetch-and-store is implemented using atomic processor instructions, false otherwise.
T * fetchAndStoreOrdered(T *newValue)
Atomic fetch-and-store.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
T * fetchAndStoreRelease(T *newValue)
Atomic fetch-and-store.
static bool isTestAndSetWaitFree()
Returns true if atomic test-and-set is wait-free, false otherwise.
QAtomicInt(const QAtomicInt &other)
Constructs a copy of other.
bool testAndSetOrdered(T *expectedValue, T *newValue)
Atomic test-and-set.
T * fetchAndStoreRelaxed(T *newValue)
Atomic fetch-and-store.
QAtomicInt & operator=(const QAtomicInt &other)
Assigns other to this QAtomicInt and returns a reference to this QAtomicInt.
bool testAndSetRelease(T *expectedValue, T *newValue)
Atomic test-and-set.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool testAndSetRelaxed(T *expectedValue, T *newValue)
Atomic test-and-set.
T * fetchAndAddAcquire(qptrdiff valueToAdd)
Atomic fetch-and-add.
QIntegerForSizeof< void * >::Signed qptrdiff
bool operator!=(T *value) const
Returns true if the value of this QAtomicPointer is not equal to value; otherwise returns false...
static bool isFetchAndAddNative()
Returns true if fetch-and-add is implemented using atomic processor instructions, false otherwise...
QAtomicInt & operator=(int value)
Assigns the value to this QAtomicInt and returns a reference to this QAtomicInt.
static bool isFetchAndAddWaitFree()
Returns true if atomic fetch-and-add is wait-free, false otherwise.
static bool isTestAndSetNative()
Returns true if test-and-set is implemented using atomic processor instructions, false otherwise...
bool operator!() const
Returns true is the current value of this QAtomicPointer is zero; otherwise returns false...
bool operator!=(const T *o, const QPointer< T > &p)
The QAtomicPointer class is a template class that provides platform-independent atomic operations on ...
void qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
T * fetchAndAddOrdered(qptrdiff valueToAdd)
Atomic fetch-and-add.
bool operator==(const T *o, const QPointer< T > &p)
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
Atomic fetch-and-add.
T * fetchAndStoreAcquire(T *newValue)
Atomic fetch-and-store.
T * fetchAndAddRelease(qptrdiff valueToAdd)
Atomic fetch-and-add.
QAtomicPointer(const QAtomicPointer< T > &other)
Constructs a copy of other.
bool testAndSetAcquire(T *expectedValue, T *newValue)
Atomic test-and-set.
static bool isFetchAndStoreWaitFree()
Returns true if atomic fetch-and-store is wait-free, false otherwise.
QAtomicPointer< T > & operator=(T *value)
Assigns the value to this QAtomicPointer and returns a reference to this QAtomicPointer.
QAtomicInt(int value=0)
Constructs a QAtomicInt with the given value.