summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-12-02 17:51:25 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-10 17:55:15 +0100
commitbfe0db6fbea6376dbe395af6d76995a54bbc3b49 (patch)
tree7c2afb16be7ff5830ae23dca72940468f67281d1 /src/corelib/thread
parent2fac63c76d1527c2ef0bf77355d944efaa59af3d (diff)
Remove all "old atomic" code from Qt
The new atomic code was introduced in Qt 5.0. The platforms that did not get ported were announced as deprecated in Qt 5.2. The code is now removed in Qt 5.3. The status for the platform/compiler/OS combinations affected is: * Linux with GCC or Clang: still compiles on all platforms (via qatomic_cxx11.h or qatomic_gcc.h) * INTEGRITY with Green Hills compiler: no longer compiles * Solaris on UltraSPARC, with Sun Studio: no longer compiles * AIX on POWER5 or 6, with IBM Visual Age: no longer compiles (probably did not compile Qt 5.0 either) * VxWorks in kernel mode: no longer compiles [ChangeLog][General] Support for the following platforms has been removed, due to lack of interest in updating support: INTEGRITY, VxWorks, Solaris on UltraSPARC (with the Sun Studio compiler suite), AIX on POWER processors (with IBM Visual Age compiler suite). Change-Id: I8a961385fd95011c016b2b1eec52034794dae3e1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qatomic.cpp7
-rw-r--r--src/corelib/thread/qbasicatomic.h21
-rw-r--r--src/corelib/thread/qoldbasicatomic.h143
-rw-r--r--src/corelib/thread/thread.pri3
4 files changed, 8 insertions, 166 deletions
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp
index 39d136c006..b2e19dc6dc 100644
--- a/src/corelib/thread/qatomic.cpp
+++ b/src/corelib/thread/qatomic.cpp
@@ -39,6 +39,8 @@
**
****************************************************************************/
+#include "qatomic.h"
+
/*!
\class QAtomicInt
\inmodule QtCore
@@ -1126,3 +1128,8 @@
Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE to indicate that
the atomic fetch-and-add on pointers is wait-free.
*/
+
+// static checks
+#ifndef Q_ATOMIC_INT32_IS_SUPPORTED
+# error "Q_ATOMIC_INT32_IS_SUPPORTED must be defined"
+#endif
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 3bf6b0c106..9fa12ba811 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -51,33 +51,17 @@
#elif defined(Q_CC_MSVC)
# include <QtCore/qatomic_msvc.h>
-// Operating system dependent implementation
-#elif defined(Q_OS_INTEGRITY)
-# include "QtCore/qatomic_integrity.h"
-#elif defined(Q_OS_VXWORKS)
-# include "QtCore/qatomic_vxworks.h"
-
// Processor dependent implementation
-#elif defined(Q_PROCESSOR_ALPHA)
-# include "QtCore/qatomic_alpha.h"
#elif defined(Q_PROCESSOR_ARM_V7) && defined(Q_PROCESSOR_ARM_32)
# include "QtCore/qatomic_armv7.h"
#elif defined(Q_PROCESSOR_ARM_V6) && defined(Q_PROCESSOR_ARM_32)
# include "QtCore/qatomic_armv6.h"
#elif defined(Q_PROCESSOR_ARM_V5) && defined(Q_PROCESSOR_ARM_32)
# include "QtCore/qatomic_armv5.h"
-#elif defined(Q_PROCESSOR_BFIN)
-# include "QtCore/qatomic_bfin.h"
#elif defined(Q_PROCESSOR_IA64)
# include "QtCore/qatomic_ia64.h"
#elif defined(Q_PROCESSOR_MIPS)
# include "QtCore/qatomic_mips.h"
-#elif defined(Q_PROCESSOR_POWER)
-# include "QtCore/qatomic_power.h"
-#elif defined(Q_PROCESSOR_S390)
-# include "QtCore/qatomic_s390.h"
-#elif defined(Q_PROCESSOR_SH4A)
-# include "QtCore/qatomic_sh4a.h"
#elif defined(Q_PROCESSOR_SPARC)
# include "QtCore/qatomic_sparc.h"
#elif defined(Q_PROCESSOR_X86)
@@ -98,9 +82,6 @@
# error "Qt has not been ported to this platform"
#endif
-// Only include if the implementation has been ported to QAtomicOps
-#ifndef QOLDBASICATOMIC_H
-
QT_BEGIN_NAMESPACE
#if 0
@@ -266,6 +247,4 @@ public:
QT_END_NAMESPACE
-#endif // QOLDBASICATOMIC_H
-
#endif // QBASICATOMIC_H
diff --git a/src/corelib/thread/qoldbasicatomic.h b/src/corelib/thread/qoldbasicatomic.h
deleted file mode 100644
index 473f1a5b0f..0000000000
--- a/src/corelib/thread/qoldbasicatomic.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOLDBASICATOMIC_H
-#define QOLDBASICATOMIC_H
-
-#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-
-#if 0
-// silence syncqt warnings
-QT_END_NAMESPACE
-#pragma qt_sync_skip_header_check
-#pragma qt_no_master_include
-#pragma qt_sync_stop_processing
-#endif
-
-class Q_CORE_EXPORT QBasicAtomicInt
-{
-public:
- volatile int _q_value;
-
- // Atomic API, implemented in qatomic_XXX.h
-
- int load() const { return _q_value; }
- int loadAcquire() const { return _q_value; }
- void store(int newValue) { _q_value = newValue; }
- void storeRelease(int newValue) { _q_value = newValue; }
-
- static bool isReferenceCountingNative();
- static bool isReferenceCountingWaitFree();
-
- bool ref();
- bool deref();
-
- static bool isTestAndSetNative();
- static bool isTestAndSetWaitFree();
-
- bool testAndSetRelaxed(int expectedValue, int newValue);
- bool testAndSetAcquire(int expectedValue, int newValue);
- bool testAndSetRelease(int expectedValue, int newValue);
- bool testAndSetOrdered(int expectedValue, int newValue);
-
- static bool isFetchAndStoreNative();
- static bool isFetchAndStoreWaitFree();
-
- int fetchAndStoreRelaxed(int newValue);
- int fetchAndStoreAcquire(int newValue);
- int fetchAndStoreRelease(int newValue);
- int fetchAndStoreOrdered(int newValue);
-
- static bool isFetchAndAddNative();
- static bool isFetchAndAddWaitFree();
-
- int fetchAndAddRelaxed(int valueToAdd);
- int fetchAndAddAcquire(int valueToAdd);
- int fetchAndAddRelease(int valueToAdd);
- int fetchAndAddOrdered(int valueToAdd);
-};
-
-template <typename T>
-class QBasicAtomicPointer
-{
-public:
- T * volatile _q_value;
-
- // Atomic API, implemented in qatomic_XXX.h
-
- T *load() const { return _q_value; }
- T *loadAcquire() const { return _q_value; }
- void store(T *newValue) { _q_value = newValue; }
- void storeRelease(T *newValue) { _q_value = newValue; }
-
- static bool isTestAndSetNative();
- static bool isTestAndSetWaitFree();
-
- bool testAndSetRelaxed(T *expectedValue, T *newValue);
- bool testAndSetAcquire(T *expectedValue, T *newValue);
- bool testAndSetRelease(T *expectedValue, T *newValue);
- bool testAndSetOrdered(T *expectedValue, T *newValue);
-
- static bool isFetchAndStoreNative();
- static bool isFetchAndStoreWaitFree();
-
- T *fetchAndStoreRelaxed(T *newValue);
- T *fetchAndStoreAcquire(T *newValue);
- T *fetchAndStoreRelease(T *newValue);
- T *fetchAndStoreOrdered(T *newValue);
-
- static bool isFetchAndAddNative();
- static bool isFetchAndAddWaitFree();
-
- T *fetchAndAddRelaxed(qptrdiff valueToAdd);
- T *fetchAndAddAcquire(qptrdiff valueToAdd);
- T *fetchAndAddRelease(qptrdiff valueToAdd);
- T *fetchAndAddOrdered(qptrdiff valueToAdd);
-};
-
-#define Q_BASIC_ATOMIC_INITIALIZER(a) { (a) }
-
-QT_END_NAMESPACE
-
-#endif // QOLDBASICATOMIC_H
diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri
index 13f0502b62..3c1ddd984a 100644
--- a/src/corelib/thread/thread.pri
+++ b/src/corelib/thread/thread.pri
@@ -17,8 +17,7 @@ HEADERS += thread/qmutex.h \
thread/qfuturesynchronizer.h \
thread/qfuturewatcher.h \
thread/qbasicatomic.h \
- thread/qgenericatomic.h \
- thread/qoldbasicatomic.h
+ thread/qgenericatomic.h
# private headers
HEADERS += thread/qmutex_p.h \