Cleanup QThread::initialize and QThread::cleanup
The qt_global_mutexpool was private API deprecated long time ago. And there is no reason to call qt_create_tls because it is called in QThreadData::current that is called from the QObject constructor, even before QCoreApplication::init can be called. Change-Id: Idf3576d8591377811b727b12edc43dc898570ba4 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>bb10
parent
9f13a7d020
commit
38d566f713
|
|
@ -543,10 +543,6 @@ void QCoreApplication::init()
|
|||
Q_ASSERT_X(!self, "QCoreApplication", "there should be only one application object");
|
||||
QCoreApplication::self = this;
|
||||
|
||||
#ifndef QT_NO_THREAD
|
||||
QThread::initialize();
|
||||
#endif
|
||||
|
||||
// use the event dispatcher created by the app programmer (if any)
|
||||
if (!QCoreApplicationPrivate::eventDispatcher)
|
||||
QCoreApplicationPrivate::eventDispatcher = d->threadData->eventDispatcher;
|
||||
|
|
@ -602,7 +598,6 @@ QCoreApplication::~QCoreApplication()
|
|||
}
|
||||
if (globalThreadPool)
|
||||
globalThreadPool->waitForDone();
|
||||
QThread::cleanup();
|
||||
#endif
|
||||
|
||||
d_func()->threadData->eventDispatcher = 0;
|
||||
|
|
|
|||
|
|
@ -46,9 +46,6 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
// qt_global_mutexpool is here for backwards compatibility only,
|
||||
// use QMutexpool::instance() in new clode.
|
||||
Q_CORE_EXPORT QMutexPool *qt_global_mutexpool = 0;
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive))
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -84,8 +84,6 @@ private:
|
|||
QMutex::RecursionMode recursionMode;
|
||||
};
|
||||
|
||||
extern Q_CORE_EXPORT QMutexPool *qt_global_mutexpool;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_THREAD
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
#include "qthread.h"
|
||||
#include "qthreadstorage.h"
|
||||
#include "qmutex.h"
|
||||
#include "qmutexpool_p.h"
|
||||
#include "qreadwritelock.h"
|
||||
#include "qabstracteventdispatcher.h"
|
||||
|
||||
|
|
@ -537,33 +536,6 @@ void QThread::run()
|
|||
(void) exec();
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
Initializes the QThread system.
|
||||
*/
|
||||
#if defined (Q_OS_WIN)
|
||||
void qt_create_tls();
|
||||
#endif
|
||||
|
||||
void QThread::initialize()
|
||||
{
|
||||
if (qt_global_mutexpool)
|
||||
return;
|
||||
qt_global_mutexpool = QMutexPool::instance();
|
||||
|
||||
#if defined (Q_OS_WIN)
|
||||
qt_create_tls();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*! \internal
|
||||
Cleans up the QThread system.
|
||||
*/
|
||||
void QThread::cleanup()
|
||||
{
|
||||
qt_global_mutexpool = 0;
|
||||
}
|
||||
|
||||
/*! \fn void QThread::setPriority(Priority priority)
|
||||
\since 4.1
|
||||
|
||||
|
|
|
|||
|
|
@ -128,9 +128,6 @@ private:
|
|||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE(QThread)
|
||||
|
||||
static void initialize();
|
||||
static void cleanup();
|
||||
|
||||
friend class QCoreApplication;
|
||||
friend class QThreadData;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue