diff options
Diffstat (limited to 'src/corelib/thread/qthread_win.cpp')
-rw-r--r-- | src/corelib/thread/qthread_win.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 4459ae87af..57ae671897 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -61,9 +61,10 @@ # include <process.h> #endif // Q_OS_WINRT -#ifndef QT_NO_THREAD QT_BEGIN_NAMESPACE +#if QT_CONFIG(thread) + #ifdef Q_OS_WINRT inline DWORD qWinRTTlsAlloc() { return FlsAlloc(0); @@ -329,7 +330,7 @@ void qt_set_thread_name(HANDLE threadId, LPCSTR threadName) ** QThreadPrivate *************************************************************************/ -#endif // QT_NO_THREAD +#endif // QT_CONFIG(thread) QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data) { @@ -341,7 +342,7 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat #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 { @@ -359,13 +360,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi data->quitNow = thr->d_func()->exited; } - QAbstractEventDispatcher *eventDispatcher = data->eventDispatcher.load(); - if (!eventDispatcher) { - eventDispatcher = createEventDispatcher(data); - data->eventDispatcher.storeRelease(eventDispatcher); - } - - eventDispatcher->startingUp(); + data->ensureEventDispatcher(); #if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINRT) // sets the name of the current thread. @@ -449,6 +444,8 @@ void QThread::yieldCurrentThread() #endif } +#endif // QT_CONFIG(thread) + void QThread::sleep(unsigned long secs) { ::Sleep(secs * 1000); @@ -464,6 +461,8 @@ void QThread::usleep(unsigned long usecs) ::Sleep((usecs / 1000) + 1); } +#if QT_CONFIG(thread) + void QThread::start(Priority priority) { Q_D(QThread); @@ -700,5 +699,6 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority) } } +#endif // QT_CONFIG(thread) + QT_END_NAMESPACE -#endif // QT_NO_THREAD |