summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-12-29 17:11:24 +0100
committerLorn Potter <lorn.potter@gmail.com>2018-08-17 00:34:36 +0000
commit0a06e1baf9e6da5308582b9dc928f4d9fea508d0 (patch)
tree187be725390515db55f56e5f2cdebad60ee183f8 /src/corelib/global
parent815153d4a453855bb528f0fa9cb7e5a77d589a11 (diff)
Modernize the "thread" feature
Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h2
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/global/qglobalstatic.h2
-rw-r--r--src/corelib/global/qglobalstatic.qdoc2
-rw-r--r--src/corelib/global/qrandom.cpp2
5 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index b8b064d43b..a8dbb3edcd 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -115,7 +115,7 @@
#define QT_NO_SYSTEMLOCALE
#define QT_FEATURE_systemsemaphore -1
#define QT_FEATURE_temporaryfile 1
-#define QT_NO_THREAD
+#define QT_FEATURE_thread -1
#define QT_FEATURE_timezone -1
#define QT_FEATURE_topleveldomain -1
#define QT_NO_TRANSLATION
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 37cc40f577..a369bbe490 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -53,10 +53,6 @@
#include <qmutex.h>
-#ifndef QT_NO_QOBJECT
-#include <private/qthread_p.h>
-#endif
-
#include <stdlib.h>
#include <limits.h>
#include <stdarg.h>
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index 7a6dea9b92..555bdf04c1 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -55,7 +55,7 @@ enum GuardValues {
};
}
-#if defined(QT_NO_THREAD) || defined(Q_COMPILER_THREADSAFE_STATICS)
+#if !QT_CONFIG(thread) || defined(Q_COMPILER_THREADSAFE_STATICS)
// some compilers support thread-safe statics
// The IA-64 C++ ABI requires this, so we know that all GCC versions since 3.4
// support it. C++11 also requires this behavior.
diff --git a/src/corelib/global/qglobalstatic.qdoc b/src/corelib/global/qglobalstatic.qdoc
index 303709bb1d..dbea04ecab 100644
--- a/src/corelib/global/qglobalstatic.qdoc
+++ b/src/corelib/global/qglobalstatic.qdoc
@@ -264,7 +264,7 @@
[stmt.decl], but as of the time of this writing, only compilers based on
the IA-64 C++ ABI implemented it properly. The implementation requiring
thread-safe initialization is also used on the Qt bootstrapped tools, which
- define QT_NO_THREAD.
+ disable the "thread" feature.
The implementation requiring thread-safe initialization from the compiler
is the simplest: it creates the \a Type object as a function-local static
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 66deac2a29..a7d4aa303a 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -1298,7 +1298,7 @@ struct QRandEngine
};
}
-#if defined(QT_NO_THREAD) || defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
// On Windows srand() and rand() already use Thread-Local-Storage
// to store the seed between calls
static inline QRandEngine *randTLS()