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>
This commit is contained in:
parent
d0ae7bef48
commit
727039c8e8
@ -314,7 +314,7 @@ bool QThreadPoolPrivate::waitForDone(int msecs)
|
|||||||
*/
|
*/
|
||||||
void QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
|
void QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
|
||||||
{
|
{
|
||||||
if (runnable == 0 || queue.isEmpty())
|
if (runnable == 0)
|
||||||
return;
|
return;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user