projects
/
profile
/
ivi
/
qtbase.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0ae7be
)
QThreadPool: fix race on 'queue' in stealRunnable()
author
Marc Mutz
<marc.mutz@kdab.com>
Fri, 17 Aug 2012 08:57:15 +0000
(10:57 +0200)
committer
Qt by Nokia
<qt-info@nokia.com>
Fri, 17 Aug 2012 14:28:01 +0000
(16:28 +0200)
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>
src/corelib/thread/qthreadpool.cpp
patch
|
blob
|
history
diff --git
a/src/corelib/thread/qthreadpool.cpp
b/src/corelib/thread/qthreadpool.cpp
index
a923b8a
..
1c3672b
100644
(file)
--- 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;
{