diff options
author | Thiago Macieira <thiago@kde.org> | 2011-07-31 18:38:00 -0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-24 01:08:28 +0100 |
commit | ba660ea7548d86147afe30f314f67527c22c267b (patch) | |
tree | 2c4471ee8137467294ca89fd27e68d39aab9a2c9 /src/corelib/thread | |
parent | 161d5eb3239b52e6f19942721491f2632305e426 (diff) |
Port the i386 and x86-64 atomics to the new QBasicAtomic architecture
Both implementations now are very similar to one another, to the point
we could share the code if we wanted to. They are based on assembly
code for the Relaxed functions only, as the i386 and x86-64
architectures only allow for full memory ordering or something that
closely resembles it (see 8.2 "Memory ordering" in the Intel 64 and
IA-32 Architectures Software Developer's Manual Volume 3A). We could
add "lfence/mfence/sfence" in future versions if we wanted to (SSE2+).
Change-Id: I76966d9f8694edfece2c5ebd3387348fac721447
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qbasicatomic.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index fd32c55ed0..1960361f0f 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -45,6 +45,13 @@ #if defined(QT_MOC) || defined(QT_BUILD_QMAKE) || defined(QT_RCC) || defined(QT_UIC) || defined(QT_BOOTSTRAPPED) # include <QtCore/qatomic_bootstrap.h> +#elif defined(Q_CC_MSVC) + // not ported yet +# define QT_OLD_ATOMICS +#elif defined(__i386) || defined(__i386__) +# include <QtCore/qatomic_i386.h> +#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) +# include <QtCore/qatomic_x86_64.h> #else # define QT_OLD_ATOMICS #endif |