diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-01-08 12:30:57 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-01-08 12:35:24 +0100 |
commit | ad16478a76815f8f61d454bf7760aaf9ffbb4b51 (patch) | |
tree | eefdd9219cc9d59b62e042f49fc7555b980cb7a4 /src/corelib/thread | |
parent | 80a741f3616290897ba0d9f1cbd3c9c5ee62da37 (diff) | |
parent | 09c92863001790a0304a5ef389901ee2b5b6cdc2 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Based on merge done by Liang Qi
Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qthreadpool.cpp | 10 | ||||
-rw-r--r-- | src/corelib/thread/qthreadpool_p.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index c23e7ace15..69f7572b34 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -204,8 +204,8 @@ void QThreadPoolPrivate::enqueueTask(QRunnable *runnable, int priority) ++runnable->ref; // put it on the queue - QList<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin(); - QList<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd(); + QVector<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin(); + QVector<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd(); if (it != begin && priority > (*(it - 1)).second) it = std::upper_bound(begin, --it, priority); queue.insert(it - begin, qMakePair(runnable, priority)); @@ -299,7 +299,7 @@ bool QThreadPoolPrivate::waitForDone(int msecs) void QThreadPoolPrivate::clear() { QMutexLocker locker(&mutex); - for (QList<QPair<QRunnable *, int> >::const_iterator it = queue.constBegin(); + for (QVector<QPair<QRunnable *, int> >::const_iterator it = queue.constBegin(); it != queue.constEnd(); ++it) { QRunnable* r = it->first; if (r->autoDelete() && !--r->ref) @@ -319,8 +319,8 @@ bool QThreadPoolPrivate::stealRunnable(QRunnable *runnable) return false; { QMutexLocker locker(&mutex); - QList<QPair<QRunnable *, int> >::iterator it = queue.begin(); - QList<QPair<QRunnable *, int> >::iterator end = queue.end(); + QVector<QPair<QRunnable *, int> >::iterator it = queue.begin(); + QVector<QPair<QRunnable *, int> >::iterator end = queue.end(); while (it != end) { if (it->first == runnable) { diff --git a/src/corelib/thread/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h index 34728ed3e2..b03eefcc94 100644 --- a/src/corelib/thread/qthreadpool_p.h +++ b/src/corelib/thread/qthreadpool_p.h @@ -83,7 +83,7 @@ public: QSet<QThreadPoolThread *> allThreads; QQueue<QThreadPoolThread *> waitingThreads; QQueue<QThreadPoolThread *> expiredThreads; - QList<QPair<QRunnable *, int> > queue; + QVector<QPair<QRunnable *, int> > queue; QWaitCondition noActiveThreads; bool isExiting; |