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>
This commit is contained in:
parent
815153d4a4
commit
0a06e1baf9
@ -1106,10 +1106,17 @@
|
|||||||
"condition": "libs.zlib",
|
"condition": "libs.zlib",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
|
"thread": {
|
||||||
|
"label": "Thread support",
|
||||||
|
"purpose": "Provides QThread and related classes.",
|
||||||
|
"section": "Kernel",
|
||||||
|
"output": [ "publicFeature" ]
|
||||||
|
},
|
||||||
"future": {
|
"future": {
|
||||||
"label": "QFuture",
|
"label": "QFuture",
|
||||||
"purpose": "Provides QFuture and related classes.",
|
"purpose": "Provides QFuture and related classes.",
|
||||||
"section": "Kernel",
|
"section": "Kernel",
|
||||||
|
"condition": "features.thread",
|
||||||
"output": [ "publicFeature" ]
|
"output": [ "publicFeature" ]
|
||||||
},
|
},
|
||||||
"concurrent": {
|
"concurrent": {
|
||||||
@ -1122,6 +1129,7 @@
|
|||||||
"dbus": {
|
"dbus": {
|
||||||
"label": "Qt D-Bus",
|
"label": "Qt D-Bus",
|
||||||
"autoDetect": "!config.uikit && !config.android && !config.winrt",
|
"autoDetect": "!config.uikit && !config.android && !config.winrt",
|
||||||
|
"condition": "features.thread",
|
||||||
"output": [ "privateFeature", "feature" ]
|
"output": [ "privateFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"dbus-linked": {
|
"dbus-linked": {
|
||||||
@ -1153,10 +1161,12 @@
|
|||||||
},
|
},
|
||||||
"network": {
|
"network": {
|
||||||
"label": "Qt Network",
|
"label": "Qt Network",
|
||||||
|
"condition": "features.thread",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
"sql": {
|
"sql": {
|
||||||
"label": "Qt Sql",
|
"label": "Qt Sql",
|
||||||
|
"condition": "features.thread",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
"testlib": {
|
"testlib": {
|
||||||
|
@ -215,9 +215,7 @@ typedef QList<QAbstractAnimation*>::ConstIterator AnimationListConstIt;
|
|||||||
QUnifiedTimer drives animations indirectly, via QAbstractAnimationTimer.
|
QUnifiedTimer drives animations indirectly, via QAbstractAnimationTimer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
|
Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
|
||||||
#endif
|
|
||||||
|
|
||||||
QUnifiedTimer::QUnifiedTimer() :
|
QUnifiedTimer::QUnifiedTimer() :
|
||||||
QObject(), defaultDriver(this), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
|
QObject(), defaultDriver(this), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
|
||||||
@ -234,18 +232,12 @@ QUnifiedTimer::QUnifiedTimer() :
|
|||||||
QUnifiedTimer *QUnifiedTimer::instance(bool create)
|
QUnifiedTimer *QUnifiedTimer::instance(bool create)
|
||||||
{
|
{
|
||||||
QUnifiedTimer *inst;
|
QUnifiedTimer *inst;
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
if (create && !unifiedTimer()->hasLocalData()) {
|
if (create && !unifiedTimer()->hasLocalData()) {
|
||||||
inst = new QUnifiedTimer;
|
inst = new QUnifiedTimer;
|
||||||
unifiedTimer()->setLocalData(inst);
|
unifiedTimer()->setLocalData(inst);
|
||||||
} else {
|
} else {
|
||||||
inst = unifiedTimer() ? unifiedTimer()->localData() : 0;
|
inst = unifiedTimer() ? unifiedTimer()->localData() : 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
Q_UNUSED(create);
|
|
||||||
static QUnifiedTimer unifiedTimer;
|
|
||||||
inst = &unifiedTimer;
|
|
||||||
#endif
|
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,7 +546,7 @@ bool QUnifiedTimer::canUninstallAnimationDriver(QAnimationDriver *d)
|
|||||||
return d == driver && driver != &defaultDriver;
|
return d == driver && driver != &defaultDriver;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
Q_GLOBAL_STATIC(QThreadStorage<QAnimationTimer *>, animationTimer)
|
Q_GLOBAL_STATIC(QThreadStorage<QAnimationTimer *>, animationTimer)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -569,7 +561,7 @@ QAnimationTimer::QAnimationTimer() :
|
|||||||
QAnimationTimer *QAnimationTimer::instance(bool create)
|
QAnimationTimer *QAnimationTimer::instance(bool create)
|
||||||
{
|
{
|
||||||
QAnimationTimer *inst;
|
QAnimationTimer *inst;
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
if (create && !animationTimer()->hasLocalData()) {
|
if (create && !animationTimer()->hasLocalData()) {
|
||||||
inst = new QAnimationTimer;
|
inst = new QAnimationTimer;
|
||||||
animationTimer()->setLocalData(inst);
|
animationTimer()->setLocalData(inst);
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
#define QT_NO_SYSTEMLOCALE
|
#define QT_NO_SYSTEMLOCALE
|
||||||
#define QT_FEATURE_systemsemaphore -1
|
#define QT_FEATURE_systemsemaphore -1
|
||||||
#define QT_FEATURE_temporaryfile 1
|
#define QT_FEATURE_temporaryfile 1
|
||||||
#define QT_NO_THREAD
|
#define QT_FEATURE_thread -1
|
||||||
#define QT_FEATURE_timezone -1
|
#define QT_FEATURE_timezone -1
|
||||||
#define QT_FEATURE_topleveldomain -1
|
#define QT_FEATURE_topleveldomain -1
|
||||||
#define QT_NO_TRANSLATION
|
#define QT_NO_TRANSLATION
|
||||||
|
@ -53,10 +53,6 @@
|
|||||||
|
|
||||||
#include <qmutex.h>
|
#include <qmutex.h>
|
||||||
|
|
||||||
#ifndef QT_NO_QOBJECT
|
|
||||||
#include <private/qthread_p.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.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
|
// some compilers support thread-safe statics
|
||||||
// The IA-64 C++ ABI requires this, so we know that all GCC versions since 3.4
|
// 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.
|
// support it. C++11 also requires this behavior.
|
||||||
|
@ -264,7 +264,7 @@
|
|||||||
[stmt.decl], but as of the time of this writing, only compilers based on
|
[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
|
the IA-64 C++ ABI implemented it properly. The implementation requiring
|
||||||
thread-safe initialization is also used on the Qt bootstrapped tools, which
|
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
|
The implementation requiring thread-safe initialization from the compiler
|
||||||
is the simplest: it creates the \a Type object as a function-local static
|
is the simplest: it creates the \a Type object as a function-local static
|
||||||
|
@ -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
|
// On Windows srand() and rand() already use Thread-Local-Storage
|
||||||
// to store the seed between calls
|
// to store the seed between calls
|
||||||
static inline QRandEngine *randTLS()
|
static inline QRandEngine *randTLS()
|
||||||
|
@ -853,7 +853,7 @@ QByteArray QFileSystemEngine::id(int id)
|
|||||||
//static
|
//static
|
||||||
QString QFileSystemEngine::resolveUserName(uint userId)
|
QString QFileSystemEngine::resolveUserName(uint userId)
|
||||||
{
|
{
|
||||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
|
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
|
||||||
int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
|
int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||||
if (size_max == -1)
|
if (size_max == -1)
|
||||||
size_max = 1024;
|
size_max = 1024;
|
||||||
@ -862,7 +862,7 @@ QString QFileSystemEngine::resolveUserName(uint userId)
|
|||||||
|
|
||||||
#if !defined(Q_OS_INTEGRITY)
|
#if !defined(Q_OS_INTEGRITY)
|
||||||
struct passwd *pw = 0;
|
struct passwd *pw = 0;
|
||||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS)
|
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS)
|
||||||
struct passwd entry;
|
struct passwd entry;
|
||||||
getpwuid_r(userId, &entry, buf.data(), buf.size(), &pw);
|
getpwuid_r(userId, &entry, buf.data(), buf.size(), &pw);
|
||||||
#else
|
#else
|
||||||
@ -877,7 +877,7 @@ QString QFileSystemEngine::resolveUserName(uint userId)
|
|||||||
//static
|
//static
|
||||||
QString QFileSystemEngine::resolveGroupName(uint groupId)
|
QString QFileSystemEngine::resolveGroupName(uint groupId)
|
||||||
{
|
{
|
||||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
|
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
|
||||||
int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
|
int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||||
if (size_max == -1)
|
if (size_max == -1)
|
||||||
size_max = 1024;
|
size_max = 1024;
|
||||||
@ -886,7 +886,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
|
|||||||
|
|
||||||
#if !defined(Q_OS_INTEGRITY)
|
#if !defined(Q_OS_INTEGRITY)
|
||||||
struct group *gr = 0;
|
struct group *gr = 0;
|
||||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
|
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
|
||||||
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
|
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||||
if (size_max == -1)
|
if (size_max == -1)
|
||||||
size_max = 1024;
|
size_max = 1024;
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
|
|
||||||
#include "qfile.h"
|
#include "qfile.h"
|
||||||
#include "qdir.h"
|
#include "qdir.h"
|
||||||
#include "private/qmutexpool_p.h"
|
|
||||||
#include "qvarlengtharray.h"
|
#include "qvarlengtharray.h"
|
||||||
#include "qdatetime.h"
|
#include "qdatetime.h"
|
||||||
#include "qt_windows.h"
|
#include "qt_windows.h"
|
||||||
|
@ -101,7 +101,6 @@ QT_END_NAMESPACE
|
|||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <qlist.h>
|
#include <qlist.h>
|
||||||
#include <qmutex.h>
|
#include <qmutex.h>
|
||||||
#include <qsemaphore.h>
|
|
||||||
#include <qsocketnotifier.h>
|
#include <qsocketnotifier.h>
|
||||||
#include <qthread.h>
|
#include <qthread.h>
|
||||||
#include <qelapsedtimer.h>
|
#include <qelapsedtimer.h>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include "qhash.h"
|
#include "qhash.h"
|
||||||
#include "qpair.h"
|
#include "qpair.h"
|
||||||
|
#include "qmutex.h"
|
||||||
#include "qvarlengtharray.h"
|
#include "qvarlengtharray.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@ -58,9 +58,11 @@
|
|||||||
#include <qtextcodec.h>
|
#include <qtextcodec.h>
|
||||||
#ifndef QT_NO_QOBJECT
|
#ifndef QT_NO_QOBJECT
|
||||||
#include <qthread.h>
|
#include <qthread.h>
|
||||||
#include <qthreadpool.h>
|
|
||||||
#include <qthreadstorage.h>
|
#include <qthreadstorage.h>
|
||||||
#include <private/qthread_p.h>
|
#include <private/qthread_p.h>
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
|
#include <qthreadpool.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include <qelapsedtimer.h>
|
#include <qelapsedtimer.h>
|
||||||
#include <qlibraryinfo.h>
|
#include <qlibraryinfo.h>
|
||||||
@ -268,9 +270,7 @@ typedef QList<QtStartUpFunction> QStartUpFuncList;
|
|||||||
Q_GLOBAL_STATIC(QStartUpFuncList, preRList)
|
Q_GLOBAL_STATIC(QStartUpFuncList, preRList)
|
||||||
typedef QList<QtCleanUpFunction> QVFuncList;
|
typedef QList<QtCleanUpFunction> QVFuncList;
|
||||||
Q_GLOBAL_STATIC(QVFuncList, postRList)
|
Q_GLOBAL_STATIC(QVFuncList, postRList)
|
||||||
#ifndef QT_NO_QOBJECT
|
|
||||||
static QBasicMutex globalRoutinesMutex;
|
static QBasicMutex globalRoutinesMutex;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
@ -289,9 +289,7 @@ void qAddPreRoutine(QtStartUpFunction p)
|
|||||||
|
|
||||||
// Due to C++11 parallel dynamic initialization, this can be called
|
// Due to C++11 parallel dynamic initialization, this can be called
|
||||||
// from multiple threads.
|
// from multiple threads.
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
QMutexLocker locker(&globalRoutinesMutex);
|
QMutexLocker locker(&globalRoutinesMutex);
|
||||||
#endif
|
|
||||||
list->prepend(p); // in case QCoreApplication is re-created, see qt_call_pre_routines
|
list->prepend(p); // in case QCoreApplication is re-created, see qt_call_pre_routines
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,9 +298,7 @@ void qAddPostRoutine(QtCleanUpFunction p)
|
|||||||
QVFuncList *list = postRList();
|
QVFuncList *list = postRList();
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
QMutexLocker locker(&globalRoutinesMutex);
|
QMutexLocker locker(&globalRoutinesMutex);
|
||||||
#endif
|
|
||||||
list->prepend(p);
|
list->prepend(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,9 +307,7 @@ void qRemovePostRoutine(QtCleanUpFunction p)
|
|||||||
QVFuncList *list = postRList();
|
QVFuncList *list = postRList();
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
QMutexLocker locker(&globalRoutinesMutex);
|
QMutexLocker locker(&globalRoutinesMutex);
|
||||||
#endif
|
|
||||||
list->removeAll(p);
|
list->removeAll(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,9 +318,7 @@ static void qt_call_pre_routines()
|
|||||||
|
|
||||||
QVFuncList list;
|
QVFuncList list;
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
QMutexLocker locker(&globalRoutinesMutex);
|
QMutexLocker locker(&globalRoutinesMutex);
|
||||||
#endif
|
|
||||||
// Unlike qt_call_post_routines, we don't empty the list, because
|
// Unlike qt_call_post_routines, we don't empty the list, because
|
||||||
// Q_COREAPP_STARTUP_FUNCTION is a macro, so the user expects
|
// Q_COREAPP_STARTUP_FUNCTION is a macro, so the user expects
|
||||||
// the function to be executed every time QCoreApplication is created.
|
// the function to be executed every time QCoreApplication is created.
|
||||||
@ -345,9 +337,7 @@ void Q_CORE_EXPORT qt_call_post_routines()
|
|||||||
QVFuncList list;
|
QVFuncList list;
|
||||||
{
|
{
|
||||||
// extract the current list and make the stored list empty
|
// extract the current list and make the stored list empty
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
QMutexLocker locker(&globalRoutinesMutex);
|
QMutexLocker locker(&globalRoutinesMutex);
|
||||||
#endif
|
|
||||||
qSwap(*postRList, list);
|
qSwap(*postRList, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +503,7 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate()
|
|||||||
void QCoreApplicationPrivate::cleanupThreadData()
|
void QCoreApplicationPrivate::cleanupThreadData()
|
||||||
{
|
{
|
||||||
if (threadData && !threadData_clean) {
|
if (threadData && !threadData_clean) {
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
void *data = &threadData->tls;
|
void *data = &threadData->tls;
|
||||||
QThreadStorageData::finish((void **)data);
|
QThreadStorageData::finish((void **)data);
|
||||||
#endif
|
#endif
|
||||||
@ -888,7 +878,7 @@ QCoreApplication::~QCoreApplication()
|
|||||||
QCoreApplicationPrivate::is_app_running = false;
|
QCoreApplicationPrivate::is_app_running = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(QT_NO_THREAD)
|
#if QT_CONFIG(thread)
|
||||||
// Synchronize and stop the global thread pool threads.
|
// Synchronize and stop the global thread pool threads.
|
||||||
QThreadPool *globalThreadPool = 0;
|
QThreadPool *globalThreadPool = 0;
|
||||||
QT_TRY {
|
QT_TRY {
|
||||||
|
@ -50,7 +50,9 @@
|
|||||||
#include <qthread.h>
|
#include <qthread.h>
|
||||||
#include <qvariant.h>
|
#include <qvariant.h>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
#include <qsemaphore.h>
|
#include <qsemaphore.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "private/qobject_p.h"
|
#include "private/qobject_p.h"
|
||||||
#include "private/qmetaobject_p.h"
|
#include "private/qmetaobject_p.h"
|
||||||
@ -1540,14 +1542,14 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
|
|||||||
|
|
||||||
QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 1, types, args));
|
QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 1, types, args));
|
||||||
} else if (type == Qt::BlockingQueuedConnection) {
|
} else if (type == Qt::BlockingQueuedConnection) {
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
if (currentThread == objectThread)
|
if (currentThread == objectThread)
|
||||||
qWarning("QMetaObject::invokeMethod: Dead lock detected");
|
qWarning("QMetaObject::invokeMethod: Dead lock detected");
|
||||||
|
|
||||||
QSemaphore semaphore;
|
QSemaphore semaphore;
|
||||||
QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 0, 0, argv, &semaphore));
|
QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 0, 0, argv, &semaphore));
|
||||||
semaphore.acquire();
|
semaphore.acquire();
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
} else {
|
} else {
|
||||||
qWarning("QMetaObject::invokeMethod: Unknown connection type");
|
qWarning("QMetaObject::invokeMethod: Unknown connection type");
|
||||||
return false;
|
return false;
|
||||||
@ -2272,7 +2274,7 @@ bool QMetaMethod::invoke(QObject *object,
|
|||||||
: Qt::QueuedConnection;
|
: Qt::QueuedConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_NO_THREAD
|
#if !QT_CONFIG(thread)
|
||||||
if (connectionType == Qt::BlockingQueuedConnection) {
|
if (connectionType == Qt::BlockingQueuedConnection) {
|
||||||
connectionType = Qt::DirectConnection;
|
connectionType = Qt::DirectConnection;
|
||||||
}
|
}
|
||||||
@ -2348,7 +2350,7 @@ bool QMetaMethod::invoke(QObject *object,
|
|||||||
QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,
|
QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,
|
||||||
0, -1, nargs, types, args));
|
0, -1, nargs, types, args));
|
||||||
} else { // blocking queued connection
|
} else { // blocking queued connection
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
if (currentThread == objectThread) {
|
if (currentThread == objectThread) {
|
||||||
qWarning("QMetaMethod::invoke: Dead lock detected in "
|
qWarning("QMetaMethod::invoke: Dead lock detected in "
|
||||||
"BlockingQueuedConnection: Receiver is %s(%p)",
|
"BlockingQueuedConnection: Receiver is %s(%p)",
|
||||||
@ -2359,7 +2361,7 @@ bool QMetaMethod::invoke(QObject *object,
|
|||||||
QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,
|
QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,
|
||||||
0, -1, 0, 0, param, &semaphore));
|
0, -1, 0, 0, param, &semaphore));
|
||||||
semaphore.acquire();
|
semaphore.acquire();
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,9 @@
|
|||||||
#include <qpair.h>
|
#include <qpair.h>
|
||||||
#include <qvarlengtharray.h>
|
#include <qvarlengtharray.h>
|
||||||
#include <qset.h>
|
#include <qset.h>
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
#include <qsemaphore.h>
|
#include <qsemaphore.h>
|
||||||
|
#endif
|
||||||
#include <qsharedpointer.h>
|
#include <qsharedpointer.h>
|
||||||
|
|
||||||
#include <private/qorderedmutexlocker_p.h>
|
#include <private/qorderedmutexlocker_p.h>
|
||||||
@ -488,7 +490,7 @@ QMetaCallEvent::~QMetaCallEvent()
|
|||||||
free(types_);
|
free(types_);
|
||||||
free(args_);
|
free(args_);
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
if (semaphore_)
|
if (semaphore_)
|
||||||
semaphore_->release();
|
semaphore_->release();
|
||||||
#endif
|
#endif
|
||||||
@ -3727,7 +3729,7 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
|
|||||||
|| (c->connectionType == Qt::QueuedConnection)) {
|
|| (c->connectionType == Qt::QueuedConnection)) {
|
||||||
queued_activate(sender, signal_index, c, argv ? argv : empty_argv, locker);
|
queued_activate(sender, signal_index, c, argv ? argv : empty_argv, locker);
|
||||||
continue;
|
continue;
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
} else if (c->connectionType == Qt::BlockingQueuedConnection) {
|
} else if (c->connectionType == Qt::BlockingQueuedConnection) {
|
||||||
if (receiverInSameThread) {
|
if (receiverInSameThread) {
|
||||||
qWarning("Qt: Dead lock detected while activating a BlockingQueuedConnection: "
|
qWarning("Qt: Dead lock detected while activating a BlockingQueuedConnection: "
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#if !defined(Q_OS_WIN) && !defined(QT_NO_THREAD) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX) && \
|
#if !defined(Q_OS_WIN) && QT_CONFIG(thread) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX) && \
|
||||||
defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L
|
defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L
|
||||||
namespace {
|
namespace {
|
||||||
// There are two incompatible versions of strerror_r:
|
// There are two incompatible versions of strerror_r:
|
||||||
@ -130,7 +130,7 @@ static QString standardLibraryErrorString(int errorCode)
|
|||||||
s = QT_TRANSLATE_NOOP("QIODevice", "No space left on device");
|
s = QT_TRANSLATE_NOOP("QIODevice", "No space left on device");
|
||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX)
|
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX)
|
||||||
QByteArray buf(1024, Qt::Uninitialized);
|
QByteArray buf(1024, Qt::Uninitialized);
|
||||||
ret = fromstrerror_helper(strerror_r(errorCode, buf.data(), buf.size()), buf);
|
ret = fromstrerror_helper(strerror_r(errorCode, buf.data(), buf.size()), buf);
|
||||||
#else
|
#else
|
||||||
|
@ -42,8 +42,6 @@
|
|||||||
#include "qplatformdefs.h"
|
#include "qplatformdefs.h"
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qatomic.h"
|
#include "qatomic.h"
|
||||||
#include "qelapsedtimer.h"
|
#include "qelapsedtimer.h"
|
||||||
#include "qthread.h"
|
#include "qthread.h"
|
||||||
@ -739,5 +737,3 @@ QT_END_NAMESPACE
|
|||||||
#else
|
#else
|
||||||
# include "qmutex_unix.cpp"
|
# include "qmutex_unix.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -54,7 +54,7 @@ class tst_QMutex;
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
#if !defined(QT_NO_THREAD) || defined(Q_CLANG_QDOC)
|
#if QT_CONFIG(thread) || defined(Q_CLANG_QDOC)
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
# define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW
|
# define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW
|
||||||
@ -250,7 +250,7 @@ private:
|
|||||||
quintptr val;
|
quintptr val;
|
||||||
};
|
};
|
||||||
|
|
||||||
#else // QT_NO_THREAD && !Q_CLANG_QDOC
|
#else // !QT_CONFIG(thread) && !Q_CLANG_QDOC
|
||||||
|
|
||||||
class Q_CORE_EXPORT QMutex
|
class Q_CORE_EXPORT QMutex
|
||||||
{
|
{
|
||||||
@ -301,7 +301,7 @@ private:
|
|||||||
|
|
||||||
typedef QMutex QBasicMutex;
|
typedef QMutex QBasicMutex;
|
||||||
|
|
||||||
#endif // QT_NO_THREAD && !Q_CLANG_QDOC
|
#endif // !QT_CONFIG(thread) && !Q_CLANG_QDOC
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -40,8 +40,6 @@
|
|||||||
|
|
||||||
#include "qplatformdefs.h"
|
#include "qplatformdefs.h"
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qatomic.h"
|
#include "qatomic.h"
|
||||||
#include "qmutex_p.h"
|
#include "qmutex_p.h"
|
||||||
#include "qfutex_p.h"
|
#include "qfutex_p.h"
|
||||||
@ -54,7 +52,6 @@
|
|||||||
# define FUTEX_PRIVATE_FLAG 0
|
# define FUTEX_PRIVATE_FLAG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
using namespace QtFutex;
|
using namespace QtFutex;
|
||||||
@ -183,5 +180,3 @@ void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -39,9 +39,6 @@
|
|||||||
|
|
||||||
#include "qplatformdefs.h"
|
#include "qplatformdefs.h"
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
|
|
||||||
#if !defined(QT_NO_THREAD)
|
|
||||||
|
|
||||||
#include "qmutex_p.h"
|
#include "qmutex_p.h"
|
||||||
|
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
@ -89,5 +86,3 @@ void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
|
|||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif //QT_NO_THREAD
|
|
||||||
|
@ -42,8 +42,6 @@
|
|||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
#include "qstring.h"
|
#include "qstring.h"
|
||||||
#include "qelapsedtimer.h"
|
#include "qelapsedtimer.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qatomic.h"
|
#include "qatomic.h"
|
||||||
#include "qmutex_p.h"
|
#include "qmutex_p.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -159,5 +157,3 @@ void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -40,8 +40,6 @@
|
|||||||
#include "qatomic.h"
|
#include "qatomic.h"
|
||||||
#include "qmutexpool_p.h"
|
#include "qmutexpool_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive))
|
Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive))
|
||||||
@ -148,5 +146,3 @@ QMutex *QMutexPool::globalInstanceGet(const void *address)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include "QtCore/qmutex.h"
|
#include "QtCore/qmutex.h"
|
||||||
#include "QtCore/qvarlengtharray.h"
|
#include "QtCore/qvarlengtharray.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
QT_REQUIRE_CONFIG(thread);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -85,6 +85,4 @@ private:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
#endif // QMUTEXPOOL_P_H
|
#endif // QMUTEXPOOL_P_H
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include "qplatformdefs.h"
|
#include "qplatformdefs.h"
|
||||||
#include "qreadwritelock.h"
|
#include "qreadwritelock.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
#include "qthread.h"
|
#include "qthread.h"
|
||||||
#include "qwaitcondition.h"
|
#include "qwaitcondition.h"
|
||||||
@ -781,5 +780,3 @@ void QReadWriteLockPrivate::release()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
class QReadWriteLockPrivate;
|
class QReadWriteLockPrivate;
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ inline QWriteLocker::QWriteLocker(QReadWriteLock *areadWriteLock)
|
|||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else // QT_NO_THREAD
|
#else // QT_CONFIG(thread)
|
||||||
|
|
||||||
class Q_CORE_EXPORT QReadWriteLock
|
class Q_CORE_EXPORT QReadWriteLock
|
||||||
{
|
{
|
||||||
@ -225,7 +225,7 @@ private:
|
|||||||
Q_DISABLE_COPY(QWriteLocker)
|
Q_DISABLE_COPY(QWriteLocker)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include <QtCore/qhash.h>
|
#include <QtCore/qhash.h>
|
||||||
#include <QtCore/qwaitcondition.h>
|
#include <QtCore/qwaitcondition.h>
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
QT_REQUIRE_CONFIG(thread);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -99,6 +99,4 @@ public:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
#endif // QREADWRITELOCK_P_H
|
#endif // QREADWRITELOCK_P_H
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qsemaphore.h"
|
#include "qsemaphore.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
#include "qfutex_p.h"
|
#include "qfutex_p.h"
|
||||||
#include "qwaitcondition.h"
|
#include "qwaitcondition.h"
|
||||||
@ -646,5 +644,3 @@ bool QSemaphore::tryAcquire(int n, int timeout)
|
|||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -42,11 +42,10 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
QT_REQUIRE_CONFIG(thread);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
class QSemaphorePrivate;
|
class QSemaphorePrivate;
|
||||||
|
|
||||||
class Q_CORE_EXPORT QSemaphore
|
class Q_CORE_EXPORT QSemaphore
|
||||||
@ -113,8 +112,6 @@ private:
|
|||||||
int m_n;
|
int m_n;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QSEMAPHORE_H
|
#endif // QSEMAPHORE_H
|
||||||
|
@ -103,7 +103,7 @@ QThreadData::~QThreadData()
|
|||||||
|
|
||||||
void QThreadData::ref()
|
void QThreadData::ref()
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
(void) _ref.ref();
|
(void) _ref.ref();
|
||||||
Q_ASSERT(_ref.load() != 0);
|
Q_ASSERT(_ref.load() != 0);
|
||||||
#endif
|
#endif
|
||||||
@ -111,7 +111,7 @@ void QThreadData::ref()
|
|||||||
|
|
||||||
void QThreadData::deref()
|
void QThreadData::deref()
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
if (!_ref.deref())
|
if (!_ref.deref())
|
||||||
delete this;
|
delete this;
|
||||||
#endif
|
#endif
|
||||||
@ -134,7 +134,7 @@ QAdoptedThread::QAdoptedThread(QThreadData *data)
|
|||||||
{
|
{
|
||||||
// thread should be running and not finished for the lifetime
|
// thread should be running and not finished for the lifetime
|
||||||
// of the application (even if QCoreApplication goes away)
|
// of the application (even if QCoreApplication goes away)
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
d_func()->running = true;
|
d_func()->running = true;
|
||||||
d_func()->finished = false;
|
d_func()->finished = false;
|
||||||
init();
|
init();
|
||||||
@ -148,7 +148,7 @@ QAdoptedThread::~QAdoptedThread()
|
|||||||
// fprintf(stderr, "~QAdoptedThread = %p\n", this);
|
// fprintf(stderr, "~QAdoptedThread = %p\n", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
void QAdoptedThread::run()
|
void QAdoptedThread::run()
|
||||||
{
|
{
|
||||||
// this function should never be called
|
// this function should never be called
|
||||||
@ -756,7 +756,7 @@ int QThread::loopLevel() const
|
|||||||
return d->data->eventLoops.size();
|
return d->data->eventLoops.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // QT_NO_THREAD
|
#else // QT_CONFIG(thread)
|
||||||
|
|
||||||
QThread::QThread(QObject *parent)
|
QThread::QThread(QObject *parent)
|
||||||
: QObject(*(new QThreadPrivate), parent)
|
: QObject(*(new QThreadPrivate), parent)
|
||||||
@ -813,7 +813,7 @@ QThreadPrivate::~QThreadPrivate()
|
|||||||
delete data;
|
delete data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\since 5.0
|
\since 5.0
|
||||||
@ -850,7 +850,7 @@ void QThread::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\reimp
|
\reimp
|
||||||
@ -1015,7 +1015,7 @@ QDaemonThread::~QDaemonThread()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class QThreadData;
|
|||||||
class QThreadPrivate;
|
class QThreadPrivate;
|
||||||
class QAbstractEventDispatcher;
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
class Q_CORE_EXPORT QThread : public QObject
|
class Q_CORE_EXPORT QThread : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -239,7 +239,7 @@ QThread *QThread::create(Function &&f)
|
|||||||
|
|
||||||
#endif // QT_CONFIG(cxx11_future)
|
#endif // QT_CONFIG(cxx11_future)
|
||||||
|
|
||||||
#else // QT_NO_THREAD
|
#else // QT_CONFIG(thread)
|
||||||
|
|
||||||
class Q_CORE_EXPORT QThread : public QObject
|
class Q_CORE_EXPORT QThread : public QObject
|
||||||
{
|
{
|
||||||
@ -267,7 +267,7 @@ private:
|
|||||||
Q_DECLARE_PRIVATE(QThread)
|
Q_DECLARE_PRIVATE(QThread)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -57,7 +57,9 @@
|
|||||||
#include "QtCore/qthread.h"
|
#include "QtCore/qthread.h"
|
||||||
#include "QtCore/qmutex.h"
|
#include "QtCore/qmutex.h"
|
||||||
#include "QtCore/qstack.h"
|
#include "QtCore/qstack.h"
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
#include "QtCore/qwaitcondition.h"
|
#include "QtCore/qwaitcondition.h"
|
||||||
|
#endif
|
||||||
#include "QtCore/qmap.h"
|
#include "QtCore/qmap.h"
|
||||||
#include "QtCore/qcoreapplication.h"
|
#include "QtCore/qcoreapplication.h"
|
||||||
#include "private/qobject_p.h"
|
#include "private/qobject_p.h"
|
||||||
@ -141,7 +143,7 @@ private:
|
|||||||
using QVector<QPostEvent>::insert;
|
using QVector<QPostEvent>::insert;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
class Q_CORE_EXPORT QDaemonThread : public QThread
|
class Q_CORE_EXPORT QDaemonThread : public QThread
|
||||||
{
|
{
|
||||||
@ -210,7 +212,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#else // QT_NO_THREAD
|
#else // QT_CONFIG(thread)
|
||||||
|
|
||||||
class QThreadPrivate : public QObjectPrivate
|
class QThreadPrivate : public QObjectPrivate
|
||||||
{
|
{
|
||||||
@ -231,7 +233,7 @@ public:
|
|||||||
Q_DECLARE_PUBLIC(QThread)
|
Q_DECLARE_PUBLIC(QThread)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
class QThreadData
|
class QThreadData
|
||||||
{
|
{
|
||||||
@ -327,7 +329,7 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
void run() override;
|
void run() override;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
Q_STATIC_ASSERT(sizeof(pthread_t) <= sizeof(Qt::HANDLE));
|
Q_STATIC_ASSERT(sizeof(pthread_t) <= sizeof(Qt::HANDLE));
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ extern "C" {
|
|||||||
typedef void*(*QtThreadCallback)(void*);
|
typedef void*(*QtThreadCallback)(void*);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
|
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
|
||||||
{
|
{
|
||||||
@ -295,7 +295,7 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
|
#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
|
||||||
static void setCurrentThreadName(const char *name)
|
static void setCurrentThreadName(const char *name)
|
||||||
@ -513,7 +513,7 @@ void QThread::yieldCurrentThread()
|
|||||||
sched_yield();
|
sched_yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
static timespec makeTimespec(time_t secs, long nsecs)
|
static timespec makeTimespec(time_t secs, long nsecs)
|
||||||
{
|
{
|
||||||
@ -538,7 +538,7 @@ void QThread::usleep(unsigned long usecs)
|
|||||||
qt_nanosleep(makeTimespec(usecs / 1000 / 1000, usecs % (1000*1000) * 1000));
|
qt_nanosleep(makeTimespec(usecs / 1000 / 1000, usecs % (1000*1000) * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
#ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
|
#ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
|
||||||
#if defined(Q_OS_QNX)
|
#if defined(Q_OS_QNX)
|
||||||
@ -839,7 +839,7 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
#ifdef Q_OS_WINRT
|
#ifdef Q_OS_WINRT
|
||||||
inline DWORD qWinRTTlsAlloc() {
|
inline DWORD qWinRTTlsAlloc() {
|
||||||
@ -330,7 +330,7 @@ void qt_set_thread_name(HANDLE threadId, LPCSTR threadName)
|
|||||||
** QThreadPrivate
|
** QThreadPrivate
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
|
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
|
||||||
{
|
{
|
||||||
@ -342,7 +342,7 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) Q_DECL_NOEXCEPT
|
unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) Q_DECL_NOEXCEPT
|
||||||
{
|
{
|
||||||
@ -444,7 +444,7 @@ void QThread::yieldCurrentThread()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
void QThread::sleep(unsigned long secs)
|
void QThread::sleep(unsigned long secs)
|
||||||
{
|
{
|
||||||
@ -461,7 +461,7 @@ void QThread::usleep(unsigned long usecs)
|
|||||||
::Sleep((usecs / 1000) + 1);
|
::Sleep((usecs / 1000) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
void QThread::start(Priority priority)
|
void QThread::start(Priority priority)
|
||||||
{
|
{
|
||||||
@ -699,6 +699,6 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -43,8 +43,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(QThreadPool, theInstance)
|
Q_GLOBAL_STATIC(QThreadPool, theInstance)
|
||||||
@ -730,5 +728,3 @@ void QThreadPool::cancel(QRunnable *runnable)
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#include "moc_qthreadpool.cpp"
|
#include "moc_qthreadpool.cpp"
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#include <QtCore/qthread.h>
|
#include <QtCore/qthread.h>
|
||||||
#include <QtCore/qrunnable.h>
|
#include <QtCore/qrunnable.h>
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
QT_REQUIRE_CONFIG(thread);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -97,6 +97,4 @@ public:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
#include "QtCore/qqueue.h"
|
#include "QtCore/qqueue.h"
|
||||||
#include "private/qobject_p.h"
|
#include "private/qobject_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
QT_REQUIRE_CONFIG(thread);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -184,5 +184,4 @@ public:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include "qthreadstorage.h"
|
#include "qthreadstorage.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qthread.h"
|
#include "qthread.h"
|
||||||
#include "qthread_p.h"
|
#include "qthread_p.h"
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
@ -323,6 +322,4 @@ void QThreadStorageData::finish(void **p)
|
|||||||
\sa localData(), hasLocalData()
|
\sa localData(), hasLocalData()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ public:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#else // !QT_NO_THREAD
|
#else // !QT_CONFIG(thread)
|
||||||
|
|
||||||
#include <qscopedpointer.h>
|
#include <qscopedpointer.h>
|
||||||
|
|
||||||
@ -227,6 +227,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
#endif // QTHREADSTORAGE_H
|
#endif // QTHREADSTORAGE_H
|
||||||
|
@ -46,8 +46,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
class QDeadlineTimer;
|
class QDeadlineTimer;
|
||||||
class QWaitConditionPrivate;
|
class QWaitConditionPrivate;
|
||||||
@ -98,7 +97,7 @@ public:
|
|||||||
void wakeAll() {}
|
void wakeAll() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -56,8 +56,6 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
@ -264,5 +262,3 @@ bool QWaitCondition::wait(QReadWriteLock *readWriteLock, QDeadlineTimer deadline
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -45,8 +45,6 @@
|
|||||||
#include "qlist.h"
|
#include "qlist.h"
|
||||||
#include "qalgorithms.h"
|
#include "qalgorithms.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
#define Q_MUTEX_T void*
|
#define Q_MUTEX_T void*
|
||||||
#include <private/qmutex_p.h>
|
#include <private/qmutex_p.h>
|
||||||
#include <private/qreadwritelock_p.h>
|
#include <private/qreadwritelock_p.h>
|
||||||
@ -247,4 +245,3 @@ void QWaitCondition::wakeAll()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -1,38 +1,66 @@
|
|||||||
# Qt core thread module
|
# Qt core thread module
|
||||||
|
|
||||||
# public headers
|
HEADERS += \
|
||||||
HEADERS += thread/qmutex.h \
|
thread/qmutex.h \
|
||||||
thread/qrunnable.h \
|
thread/qreadwritelock.h \
|
||||||
thread/qreadwritelock.h \
|
thread/qrunnable.h \
|
||||||
thread/qsemaphore.h \
|
thread/qthread.h \
|
||||||
thread/qthread.h \
|
thread/qthreadstorage.h \
|
||||||
thread/qthreadpool.h \
|
thread/qwaitcondition.h
|
||||||
thread/qthreadstorage.h \
|
|
||||||
thread/qwaitcondition.h \
|
|
||||||
thread/qatomic.h \
|
|
||||||
thread/qatomic_bootstrap.h \
|
|
||||||
thread/qatomic_cxx11.h \
|
|
||||||
thread/qbasicatomic.h \
|
|
||||||
thread/qgenericatomic.h
|
|
||||||
|
|
||||||
# private headers
|
SOURCES += \
|
||||||
HEADERS += thread/qmutex_p.h \
|
thread/qrunnable.cpp \
|
||||||
thread/qmutexpool_p.h \
|
thread/qthread.cpp
|
||||||
thread/qfutex_p.h \
|
|
||||||
thread/qorderedmutexlocker_p.h \
|
|
||||||
thread/qreadwritelock_p.h \
|
|
||||||
thread/qthread_p.h \
|
|
||||||
thread/qthreadpool_p.h
|
|
||||||
|
|
||||||
SOURCES += thread/qatomic.cpp \
|
win32 {
|
||||||
thread/qmutex.cpp \
|
HEADERS += thread/qatomic_msvc.h
|
||||||
thread/qreadwritelock.cpp \
|
|
||||||
thread/qrunnable.cpp \
|
SOURCES += thread/qthread_win.cpp
|
||||||
thread/qmutexpool.cpp \
|
} else {
|
||||||
thread/qsemaphore.cpp \
|
SOURCES += thread/qthread_unix.cpp
|
||||||
thread/qthread.cpp \
|
}
|
||||||
thread/qthreadpool.cpp \
|
|
||||||
thread/qthreadstorage.cpp
|
qtConfig(thread) {
|
||||||
|
HEADERS += \
|
||||||
|
thread/qatomic.h \
|
||||||
|
thread/qatomic_bootstrap.h \
|
||||||
|
thread/qatomic_cxx11.h \
|
||||||
|
thread/qbasicatomic.h \
|
||||||
|
thread/qfutex_p.h \
|
||||||
|
thread/qgenericatomic.h \
|
||||||
|
thread/qmutexpool_p.h \
|
||||||
|
thread/qmutex_p.h \
|
||||||
|
thread/qorderedmutexlocker_p.h \
|
||||||
|
thread/qreadwritelock_p.h \
|
||||||
|
thread/qsemaphore.h \
|
||||||
|
thread/qthreadpool.h \
|
||||||
|
thread/qthreadpool_p.h \
|
||||||
|
thread/qthread_p.h
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
thread/qatomic.cpp \
|
||||||
|
thread/qmutex.cpp \
|
||||||
|
thread/qmutexpool.cpp \
|
||||||
|
thread/qreadwritelock.cpp \
|
||||||
|
thread/qsemaphore.cpp \
|
||||||
|
thread/qthreadpool.cpp \
|
||||||
|
thread/qthreadstorage.cpp
|
||||||
|
|
||||||
|
win32 {
|
||||||
|
SOURCES += \
|
||||||
|
thread/qmutex_win.cpp \
|
||||||
|
thread/qwaitcondition_win.cpp
|
||||||
|
} else {
|
||||||
|
darwin {
|
||||||
|
SOURCES += thread/qmutex_mac.cpp
|
||||||
|
} else: linux {
|
||||||
|
SOURCES += thread/qmutex_linux.cpp
|
||||||
|
} else {
|
||||||
|
SOURCES += thread/qmutex_unix.cpp
|
||||||
|
}
|
||||||
|
SOURCES += thread/qwaitcondition_unix.cpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
qtConfig(future) {
|
qtConfig(future) {
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
@ -52,24 +80,4 @@ qtConfig(future) {
|
|||||||
thread/qresultstore.cpp
|
thread/qresultstore.cpp
|
||||||
}
|
}
|
||||||
|
|
||||||
win32 {
|
|
||||||
HEADERS += thread/qatomic_msvc.h
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
thread/qmutex_win.cpp \
|
|
||||||
thread/qthread_win.cpp \
|
|
||||||
thread/qwaitcondition_win.cpp
|
|
||||||
} else {
|
|
||||||
darwin {
|
|
||||||
SOURCES += thread/qmutex_mac.cpp
|
|
||||||
} else: linux {
|
|
||||||
SOURCES += thread/qmutex_linux.cpp
|
|
||||||
} else {
|
|
||||||
SOURCES += thread/qmutex_unix.cpp
|
|
||||||
}
|
|
||||||
SOURCES += \
|
|
||||||
thread/qthread_unix.cpp \
|
|
||||||
thread/qwaitcondition_unix.cpp
|
|
||||||
}
|
|
||||||
|
|
||||||
qtConfig(std-atomic64): QMAKE_USE += libatomic
|
qtConfig(std-atomic64): QMAKE_USE += libatomic
|
||||||
|
@ -2339,7 +2339,7 @@ static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localT
|
|||||||
// localtime_r() does not have this requirement, so make an explicit call.
|
// localtime_r() does not have this requirement, so make an explicit call.
|
||||||
// The explicit call should also request the timezone info be re-parsed.
|
// The explicit call should also request the timezone info be re-parsed.
|
||||||
qt_tzset();
|
qt_tzset();
|
||||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
|
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
|
||||||
// Use the reentrant version of localtime() where available
|
// Use the reentrant version of localtime() where available
|
||||||
// as is thread-safe and doesn't use a shared static data area
|
// as is thread-safe and doesn't use a shared static data area
|
||||||
tm *res = 0;
|
tm *res = 0;
|
||||||
|
@ -79,10 +79,8 @@ bool qdbus_loadLibDBus()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool triedToLoadLibrary = false;
|
static bool triedToLoadLibrary = false;
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
static QBasicMutex mutex;
|
static QBasicMutex mutex;
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
#endif
|
|
||||||
|
|
||||||
QLibrary *&lib = qdbus_libdbus;
|
QLibrary *&lib = qdbus_libdbus;
|
||||||
if (triedToLoadLibrary)
|
if (triedToLoadLibrary)
|
||||||
|
@ -979,7 +979,7 @@
|
|||||||
},
|
},
|
||||||
"evdev": {
|
"evdev": {
|
||||||
"label": "evdev",
|
"label": "evdev",
|
||||||
"condition": "tests.evdev",
|
"condition": "features.thread && tests.evdev",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
"freetype": {
|
"freetype": {
|
||||||
@ -1170,7 +1170,7 @@
|
|||||||
},
|
},
|
||||||
"egl_x11": {
|
"egl_x11": {
|
||||||
"label": "EGL on X11",
|
"label": "EGL on X11",
|
||||||
"condition": "features.egl && tests.egl-x11",
|
"condition": "features.thread && features.egl && tests.egl-x11",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
"eglfs": {
|
"eglfs": {
|
||||||
@ -1300,7 +1300,7 @@
|
|||||||
"section": "Platform plugins",
|
"section": "Platform plugins",
|
||||||
"autoDetect": "!config.darwin",
|
"autoDetect": "!config.darwin",
|
||||||
"enable": "input.xcb == 'system' || input.xcb == 'qt' || input.xcb == 'yes'",
|
"enable": "input.xcb == 'system' || input.xcb == 'qt' || input.xcb == 'yes'",
|
||||||
"condition": "libs.xcb",
|
"condition": "features.thread && libs.xcb",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
"system-xcb": {
|
"system-xcb": {
|
||||||
|
@ -2703,18 +2703,6 @@ static const int slow_timeout = 300000; // 5m
|
|||||||
|
|
||||||
const uint QFontCache::min_cost = 4*1024; // 4mb
|
const uint QFontCache::min_cost = 4*1024; // 4mb
|
||||||
|
|
||||||
#ifdef QT_NO_THREAD
|
|
||||||
Q_GLOBAL_STATIC(QFontCache, theFontCache)
|
|
||||||
|
|
||||||
QFontCache *QFontCache::instance()
|
|
||||||
{
|
|
||||||
return theFontCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QFontCache::cleanup()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
Q_GLOBAL_STATIC(QThreadStorage<QFontCache *>, theFontCache)
|
Q_GLOBAL_STATIC(QThreadStorage<QFontCache *>, theFontCache)
|
||||||
|
|
||||||
QFontCache *QFontCache::instance()
|
QFontCache *QFontCache::instance()
|
||||||
@ -2736,7 +2724,6 @@ void QFontCache::cleanup()
|
|||||||
if (cache && cache->hasLocalData())
|
if (cache && cache->hasLocalData())
|
||||||
cache->setLocalData(0);
|
cache->setLocalData(0);
|
||||||
}
|
}
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
QBasicAtomicInt font_cache_id = Q_BASIC_ATOMIC_INITIALIZER(1);
|
QBasicAtomicInt font_cache_id = Q_BASIC_ATOMIC_INITIALIZER(1);
|
||||||
|
|
||||||
|
@ -263,6 +263,7 @@
|
|||||||
"label": "HTTP",
|
"label": "HTTP",
|
||||||
"purpose": "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager.",
|
"purpose": "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager.",
|
||||||
"section": "Networking",
|
"section": "Networking",
|
||||||
|
"condition": "features.thread",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"udpsocket": {
|
"udpsocket": {
|
||||||
@ -301,7 +302,7 @@
|
|||||||
"label": "Bearer management",
|
"label": "Bearer management",
|
||||||
"purpose": "Provides bearer management for the network stack.",
|
"purpose": "Provides bearer management for the network stack.",
|
||||||
"section": "Networking",
|
"section": "Networking",
|
||||||
"condition": "features.library && features.networkinterface && features.properties",
|
"condition": "features.thread && features.library && features.networkinterface && features.properties",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"localserver": {
|
"localserver": {
|
||||||
|
@ -903,12 +903,10 @@ bool q_resolveOpenSslSymbols()
|
|||||||
{
|
{
|
||||||
static bool symbolsResolved = false;
|
static bool symbolsResolved = false;
|
||||||
static bool triedToResolveSymbols = false;
|
static bool triedToResolveSymbols = false;
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#if QT_CONFIG(opensslv11)
|
#if QT_CONFIG(opensslv11)
|
||||||
QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_OPENSSL_init_ssl));
|
QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_OPENSSL_init_ssl));
|
||||||
#else
|
#else
|
||||||
QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_SSL_library_init));
|
QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_SSL_library_init));
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
if (symbolsResolved)
|
if (symbolsResolved)
|
||||||
return true;
|
return true;
|
||||||
|
@ -43,14 +43,9 @@
|
|||||||
#include "private/qguiapplication_p.h"
|
#include "private/qguiapplication_p.h"
|
||||||
|
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
#include <qpa/qwindowsysteminterface.h>
|
||||||
#include <QtCore/QElapsedTimer>
|
|
||||||
#include <QtCore/QAtomicInt>
|
|
||||||
#include <QtCore/QSemaphore>
|
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QT_USE_NAMESPACE
|
QT_USE_NAMESPACE
|
||||||
|
@ -139,14 +139,6 @@ QtFreetypeData::~QtFreetypeData()
|
|||||||
library = 0;
|
library = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_NO_THREAD
|
|
||||||
Q_GLOBAL_STATIC(QtFreetypeData, theFreetypeData)
|
|
||||||
|
|
||||||
QtFreetypeData *qt_getFreetypeData()
|
|
||||||
{
|
|
||||||
return theFreetypeData();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
Q_GLOBAL_STATIC(QThreadStorage<QtFreetypeData *>, theFreetypeData)
|
Q_GLOBAL_STATIC(QThreadStorage<QtFreetypeData *>, theFreetypeData)
|
||||||
|
|
||||||
QtFreetypeData *qt_getFreetypeData()
|
QtFreetypeData *qt_getFreetypeData()
|
||||||
@ -169,7 +161,6 @@ QtFreetypeData *qt_getFreetypeData()
|
|||||||
}
|
}
|
||||||
return freetypeData;
|
return freetypeData;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
FT_Library qt_getFreetype()
|
FT_Library qt_getFreetype()
|
||||||
{
|
{
|
||||||
|
@ -1231,7 +1231,6 @@ void QWindowsFontDatabase::populateFontDatabase()
|
|||||||
|
|
||||||
typedef QSharedPointer<QWindowsFontEngineData> QWindowsFontEngineDataPtr;
|
typedef QSharedPointer<QWindowsFontEngineData> QWindowsFontEngineDataPtr;
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
typedef QThreadStorage<QWindowsFontEngineDataPtr> FontEngineThreadLocalData;
|
typedef QThreadStorage<QWindowsFontEngineDataPtr> FontEngineThreadLocalData;
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(FontEngineThreadLocalData, fontEngineThreadLocalData)
|
Q_GLOBAL_STATIC(FontEngineThreadLocalData, fontEngineThreadLocalData)
|
||||||
@ -1243,17 +1242,6 @@ QSharedPointer<QWindowsFontEngineData> sharedFontData()
|
|||||||
data->setLocalData(QSharedPointer<QWindowsFontEngineData>::create());
|
data->setLocalData(QSharedPointer<QWindowsFontEngineData>::create());
|
||||||
return data->localData();
|
return data->localData();
|
||||||
}
|
}
|
||||||
#else // !QT_NO_THREAD
|
|
||||||
Q_GLOBAL_STATIC(QWindowsFontEngineDataPtr, fontEngineData)
|
|
||||||
|
|
||||||
QWindowsFontEngineDataPtr sharedFontData()
|
|
||||||
{
|
|
||||||
QWindowsFontEngineDataPtr *data = fontEngineData();
|
|
||||||
if (data->isNull())
|
|
||||||
*data = QWindowsFontEngineDataPtr::create();
|
|
||||||
return *data;
|
|
||||||
}
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
QWindowsFontDatabase::QWindowsFontDatabase()
|
QWindowsFontDatabase::QWindowsFontDatabase()
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ class QWindowsThreadPoolRunner
|
|||||||
{
|
{
|
||||||
Q_DISABLE_COPY(QWindowsThreadPoolRunner)
|
Q_DISABLE_COPY(QWindowsThreadPoolRunner)
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
template <class RunnableFunction> // nested class implementing QRunnable to execute a function.
|
template <class RunnableFunction> // nested class implementing QRunnable to execute a function.
|
||||||
class Runnable : public QRunnable
|
class Runnable : public QRunnable
|
||||||
{
|
{
|
||||||
@ -104,7 +104,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
QWaitCondition m_condition;
|
QWaitCondition m_condition;
|
||||||
#else // !QT_NO_THREAD
|
#else // QT_CONFIG(thread)
|
||||||
public:
|
public:
|
||||||
QWindowsThreadPoolRunner() {}
|
QWindowsThreadPoolRunner() {}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
f();
|
f();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // QT_NO_THREAD
|
#endif // QT_CONFIG(thread)
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -1454,7 +1454,7 @@ bool QMYSQLDriver::open(const QString& db,
|
|||||||
d->preparedQuerysEnabled = false;
|
d->preparedQuerysEnabled = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
mysql_thread_init();
|
mysql_thread_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1468,7 +1468,7 @@ void QMYSQLDriver::close()
|
|||||||
{
|
{
|
||||||
Q_D(QMYSQLDriver);
|
Q_D(QMYSQLDriver);
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
mysql_thread_end();
|
mysql_thread_end();
|
||||||
#endif
|
#endif
|
||||||
mysql_close(d->mysql);
|
mysql_close(d->mysql);
|
||||||
|
@ -573,8 +573,11 @@ void QPrintPreviewDialogPrivate::_q_print()
|
|||||||
if (printer->outputFormat() != QPrinter::NativeFormat) {
|
if (printer->outputFormat() != QPrinter::NativeFormat) {
|
||||||
QString title = QCoreApplication::translate("QPrintPreviewDialog", "Export to PDF");
|
QString title = QCoreApplication::translate("QPrintPreviewDialog", "Export to PDF");
|
||||||
QString suffix = QLatin1String(".pdf");
|
QString suffix = QLatin1String(".pdf");
|
||||||
QString fileName = QFileDialog::getSaveFileName(q, title, printer->outputFileName(),
|
QString fileName;
|
||||||
|
#if QT_CONFIG(filedialog)
|
||||||
|
fileName = QFileDialog::getSaveFileName(q, title, printer->outputFileName(),
|
||||||
QLatin1Char('*') + suffix);
|
QLatin1Char('*') + suffix);
|
||||||
|
#endif
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
if (QFileInfo(fileName).suffix().isEmpty())
|
if (QFileInfo(fileName).suffix().isEmpty())
|
||||||
fileName.append(suffix);
|
fileName.append(suffix);
|
||||||
|
@ -346,7 +346,9 @@ namespace QTest
|
|||||||
static int keyDelay = -1;
|
static int keyDelay = -1;
|
||||||
static int mouseDelay = -1;
|
static int mouseDelay = -1;
|
||||||
static int eventDelay = -1;
|
static int eventDelay = -1;
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
static int timeout = -1;
|
static int timeout = -1;
|
||||||
|
#endif
|
||||||
static bool noCrashHandler = false;
|
static bool noCrashHandler = false;
|
||||||
|
|
||||||
/*! \internal
|
/*! \internal
|
||||||
@ -397,7 +399,7 @@ int Q_TESTLIB_EXPORT defaultKeyDelay()
|
|||||||
}
|
}
|
||||||
return keyDelay;
|
return keyDelay;
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
static int defaultTimeout()
|
static int defaultTimeout()
|
||||||
{
|
{
|
||||||
if (timeout == -1) {
|
if (timeout == -1) {
|
||||||
@ -409,6 +411,7 @@ static int defaultTimeout()
|
|||||||
}
|
}
|
||||||
return timeout;
|
return timeout;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Q_TESTLIB_EXPORT bool printAvailableFunctions = false;
|
Q_TESTLIB_EXPORT bool printAvailableFunctions = false;
|
||||||
Q_TESTLIB_EXPORT QStringList testFunctions;
|
Q_TESTLIB_EXPORT QStringList testFunctions;
|
||||||
@ -975,6 +978,8 @@ void TestMethods::invokeTestOnData(int index) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(thread)
|
||||||
|
|
||||||
class WatchDog : public QThread
|
class WatchDog : public QThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -1026,6 +1031,17 @@ private:
|
|||||||
QWaitCondition waitCondition;
|
QWaitCondition waitCondition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#else // !QT_CONFIG(thread)
|
||||||
|
|
||||||
|
class WatchDog : public QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void beginTest() {};
|
||||||
|
void testFinished() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
"label": "QFileSystemModel",
|
"label": "QFileSystemModel",
|
||||||
"purpose": "Provides a data model for the local filesystem.",
|
"purpose": "Provides a data model for the local filesystem.",
|
||||||
"section": "File I/O",
|
"section": "File I/O",
|
||||||
"condition": "features.itemmodel",
|
"condition": "features.itemmodel && features.thread",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"itemviews": {
|
"itemviews": {
|
||||||
|
@ -1138,7 +1138,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
|
|||||||
|
|
||||||
q->data = &data;
|
q->data = &data;
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
Q_ASSERT_X(q->thread() == qApp->thread(), "QWidget",
|
Q_ASSERT_X(q->thread() == qApp->thread(), "QWidget",
|
||||||
"Widgets must be created in the GUI thread.");
|
"Widgets must be created in the GUI thread.");
|
||||||
|
@ -144,6 +144,7 @@
|
|||||||
#include "qcompleter_p.h"
|
#include "qcompleter_p.h"
|
||||||
|
|
||||||
#include "QtWidgets/qscrollbar.h"
|
#include "QtWidgets/qscrollbar.h"
|
||||||
|
#include "QtCore/qdir.h"
|
||||||
#include "QtCore/qstringlistmodel.h"
|
#include "QtCore/qstringlistmodel.h"
|
||||||
#if QT_CONFIG(dirmodel)
|
#if QT_CONFIG(dirmodel)
|
||||||
#include "QtWidgets/qdirmodel.h"
|
#include "QtWidgets/qdirmodel.h"
|
||||||
|
@ -415,7 +415,7 @@ void tst_QCoreApplication::removePostedEvents()
|
|||||||
expected.clear();
|
expected.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
class DeliverInDefinedOrderThread : public QThread
|
class DeliverInDefinedOrderThread : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -532,7 +532,7 @@ void tst_QCoreApplication::deliverInDefinedOrder()
|
|||||||
QObject::connect(&obj, SIGNAL(done()), &app, SLOT(quit()));
|
QObject::connect(&obj, SIGNAL(done()), &app, SLOT(quit()));
|
||||||
app.exec();
|
app.exec();
|
||||||
}
|
}
|
||||||
#endif // QT_NO_QTHREAD
|
#endif // QT_CONFIG(thread)
|
||||||
|
|
||||||
void tst_QCoreApplication::applicationPid()
|
void tst_QCoreApplication::applicationPid()
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ private slots:
|
|||||||
void argc();
|
void argc();
|
||||||
void postEvent();
|
void postEvent();
|
||||||
void removePostedEvents();
|
void removePostedEvents();
|
||||||
#ifndef QT_NO_THREAD
|
#if QT_CONFIG(thread)
|
||||||
void deliverInDefinedOrder();
|
void deliverInDefinedOrder();
|
||||||
#endif
|
#endif
|
||||||
void applicationPid();
|
void applicationPid();
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "qplatformdefs.h"
|
#include "qplatformdefs.h"
|
||||||
#include "qthreadonce.h"
|
#include "qthreadonce.h"
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, onceInitializationMutex, (QMutex::Recursive))
|
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, onceInitializationMutex, (QMutex::Recursive))
|
||||||
@ -104,5 +103,3 @@ void QOnceControl::done()
|
|||||||
{
|
{
|
||||||
extra &= ~MustRunCode;
|
extra &= ~MustRunCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
#include <QtCore/qatomic.h>
|
#include <QtCore/qatomic.h>
|
||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
|
||||||
|
|
||||||
class QOnceControl
|
class QOnceControl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -91,6 +89,4 @@ public:
|
|||||||
inline operator T*() { return value(); }
|
inline operator T*() { return value(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_THREAD
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,22 +1,25 @@
|
|||||||
TEMPLATE=subdirs
|
TEMPLATE=subdirs
|
||||||
SUBDIRS=\
|
|
||||||
qatomicint \
|
qtHaveFeature(thread) {
|
||||||
qatomicinteger \
|
SUBDIRS=\
|
||||||
qatomicpointer \
|
qatomicint \
|
||||||
qresultstore \
|
qatomicinteger \
|
||||||
qfuture \
|
qatomicpointer \
|
||||||
qfuturesynchronizer \
|
qresultstore \
|
||||||
qmutex \
|
qfuture \
|
||||||
qmutexlocker \
|
qfuturesynchronizer \
|
||||||
qreadlocker \
|
qmutex \
|
||||||
qreadwritelock \
|
qmutexlocker \
|
||||||
qsemaphore \
|
qreadlocker \
|
||||||
qthread \
|
qreadwritelock \
|
||||||
qthreadonce \
|
qsemaphore \
|
||||||
qthreadpool \
|
qthread \
|
||||||
qthreadstorage \
|
qthreadonce \
|
||||||
qwaitcondition \
|
qthreadpool \
|
||||||
qwritelocker
|
qthreadstorage \
|
||||||
|
qwaitcondition \
|
||||||
|
qwritelocker
|
||||||
|
}
|
||||||
|
|
||||||
qtHaveModule(concurrent) {
|
qtHaveModule(concurrent) {
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user