qt5base-lts/tests/auto/corelib/thread
Marc Mutz b4689401a5 tst_QThreadPool: don't deadlock when a cancel() test fails
We keep the runnables from finishing by having them block
on a QSemaphore::acquire() call inside run().

If we fail a test that precedes the call to sem.release()
further into the test, the early return will cause the
thread pool to be destroyed, which will then attempt to
wait for the runnables to finished, which, in turn wait
for the semaphore to be released.

-> dead lock

Fix by introducing a RAII object to release the semaphore
with a sufficiently large number to unblock all runnables.
That number will in some situations be too large, but that
does not matter.

Change-Id: I1ec7e29b37bc36309e93e6e30708cc7db3c9579c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 11:25:48 +00:00
..
qatomicint Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
qatomicinteger Merge remote-tracking branch 'origin/5.6' into 5.7 2016-03-24 20:37:33 +01:00
qatomicpointer Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
qfuture Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
qfuturesynchronizer Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
qfuturewatcher Updated license headers 2016-01-21 18:55:18 +00:00
qmutex QMutex: make sure we try_lock_for no shorter than the duration passed 2016-11-22 11:32:35 +00:00
qmutexlocker Updated license headers 2016-01-21 18:55:18 +00:00
qreadlocker Updated license headers 2016-01-21 18:55:18 +00:00
qreadwritelock Updated license headers 2016-01-21 18:55:18 +00:00
qresultstore Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
qsemaphore tst_QSemaphore: avoid deadlock on test failures 2017-02-14 13:30:16 +00:00
qthread Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-24 10:31:21 +01:00
qthreadonce QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qthreadpool tst_QThreadPool: don't deadlock when a cancel() test fails 2017-02-15 11:25:48 +00:00
qthreadstorage winrt: Make test functional 2016-08-09 12:13:23 +00:00
qwaitcondition Blacklist tst_QWaitCondition::wakeOne() on Windows 2017-02-14 06:51:52 +00:00
qwritelocker Updated license headers 2016-01-21 18:55:18 +00:00
thread.pro Replace the type-based QAtomicIntegerTraits with a size-based one 2014-01-30 18:06:27 +01:00