Qt 4.8
Classes | Functions | Variables
qatomic_generic_windows.cpp File Reference
#include "qplatformdefs.h"
#include <QtCore/qatomic.h>

Go to the source code of this file.

Classes

class  QCriticalSection
 

Functions

Q_CORE_EXPORT int QBasicAtomicInt_fetchAndAddOrdered (volatile int *_q_value, int valueToAdd)
 
Q_CORE_EXPORT int QBasicAtomicInt_fetchAndStoreOrdered (volatile int *_q_value, int newValue)
 
Q_CORE_EXPORT bool QBasicAtomicInt_testAndSetOrdered (volatile int *_q_value, int expectedValue, int newValue)
 
Q_CORE_EXPORT void * QBasicAtomicPointer_fetchAndAddOrdered (void *volatile *_q_value, qptrdiff valueToAdd)
 
Q_CORE_EXPORT void * QBasicAtomicPointer_fetchAndStoreOrdered (void *volatile *_q_value, void *newValue)
 
Q_CORE_EXPORT bool QBasicAtomicPointer_testAndSetOrdered (void *volatile *_q_value, void *expectedValue, void *newValue)
 

Variables

static QCriticalSection qAtomicCriticalSection
 

Function Documentation

◆ QBasicAtomicInt_fetchAndAddOrdered()

Q_CORE_EXPORT int QBasicAtomicInt_fetchAndAddOrdered ( volatile int *  _q_value,
int  valueToAdd 
)

Definition at line 87 of file qatomic_generic_windows.cpp.

88 {
89  int returnValue;
91  returnValue = *_q_value;
92  *_q_value += valueToAdd;
94  return returnValue;
95 }
static QCriticalSection qAtomicCriticalSection

◆ QBasicAtomicInt_fetchAndStoreOrdered()

Q_CORE_EXPORT int QBasicAtomicInt_fetchAndStoreOrdered ( volatile int *  _q_value,
int  newValue 
)

Definition at line 76 of file qatomic_generic_windows.cpp.

77 {
78  int returnValue;
80  returnValue = *_q_value;
81  *_q_value = newValue;
83  return returnValue;
84 }
static QCriticalSection qAtomicCriticalSection

◆ QBasicAtomicInt_testAndSetOrdered()

Q_CORE_EXPORT bool QBasicAtomicInt_testAndSetOrdered ( volatile int *  _q_value,
int  expectedValue,
int  newValue 
)

Definition at line 63 of file qatomic_generic_windows.cpp.

64 {
65  bool returnValue = false;
67  if (*_q_value == expectedValue) {
68  *_q_value = newValue;
69  returnValue = true;
70  }
72  return returnValue;
73 }
static QCriticalSection qAtomicCriticalSection

◆ QBasicAtomicPointer_fetchAndAddOrdered()

Q_CORE_EXPORT void* QBasicAtomicPointer_fetchAndAddOrdered ( void *volatile *  _q_value,
qptrdiff  valueToAdd 
)

Definition at line 124 of file qatomic_generic_windows.cpp.

125 {
126  void *returnValue;
128  returnValue = *_q_value;
129  *_q_value = reinterpret_cast<char *>(returnValue) + valueToAdd;
131  return returnValue;
132 }
static QCriticalSection qAtomicCriticalSection

◆ QBasicAtomicPointer_fetchAndStoreOrdered()

Q_CORE_EXPORT void* QBasicAtomicPointer_fetchAndStoreOrdered ( void *volatile *  _q_value,
void *  newValue 
)

Definition at line 113 of file qatomic_generic_windows.cpp.

114 {
115  void *returnValue;
117  returnValue = *_q_value;
118  *_q_value = newValue;
120  return returnValue;
121 }
static QCriticalSection qAtomicCriticalSection

◆ QBasicAtomicPointer_testAndSetOrdered()

Q_CORE_EXPORT bool QBasicAtomicPointer_testAndSetOrdered ( void *volatile *  _q_value,
void *  expectedValue,
void *  newValue 
)

Definition at line 98 of file qatomic_generic_windows.cpp.

101 {
102  bool returnValue = false;
104  if (*_q_value == expectedValue) {
105  *_q_value = newValue;
106  returnValue = true;
107  }
109  return returnValue;
110 }
static QCriticalSection qAtomicCriticalSection

Variable Documentation

◆ qAtomicCriticalSection

QCriticalSection qAtomicCriticalSection
static

Definition at line 60 of file qatomic_generic_windows.cpp.