summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-08-17 10:57:15 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-17 16:28:01 +0200
commit727039c8e832b30775190683bf0aa4c293ddf7cd (patch)
treedbf2fe6dc2a8df36b267fac690302d58dead4aa5 /src/corelib/thread/qthreadpool.cpp
parentd0ae7bef48958eab7f4c8481ffcb1664e91067fc (diff)
QThreadPool: fix race on 'queue' in stealRunnable()
The code under mutex protection already implicitly handles the case where queue.empty(), so just removing the pre-lock check suffices. Change-Id: I01467aff62e61bb4efd16359dd64546ff51c6bad Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/thread/qthreadpool.cpp')
-rw-r--r--src/corelib/thread/qthreadpool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index a923b8aa41..1c3672bfb3 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -314,7 +314,7 @@ bool QThreadPoolPrivate::waitForDone(int msecs)
*/
void QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
{
- if (runnable == 0 || queue.isEmpty())
+ if (runnable == 0)
return;
bool found = false;
{