Fix tst_qthreadpool under high load.
The tasks might not have run yet at the time of the QCOMPARE, so we need to acquire on the semaphore in order to ensure that this is the case, just like in the previous testcase. Change-Id: I1da72bb07c2f53760b3bf912fc26aaf10ed18d48 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>bb10
parent
b14e4eb5f0
commit
c4650779c4
|
|
@ -381,6 +381,7 @@ void tst_QThreadPool::expiryTimeoutRace() // QTBUG-3786
|
|||
threadPool.start(&task);
|
||||
QThread::msleep(50); // exactly the same as the expiry timeout
|
||||
}
|
||||
QVERIFY(task.semaphore.tryAcquire(numTasks, 10000));
|
||||
QCOMPARE(task.runCount.load(), numTasks);
|
||||
QVERIFY(threadPool.waitForDone(2000));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue