qt5base-lts/tests/auto/corelib/thread
David Faure dacf9961da QThreadPool: fix counting of waiting threads
QTBUG-21051 has a testcase where activeThreadCount() could actually
end up at -1 (converted to an autotest in this commit).
The reason was: start() calls tryStart() which returns false due to
too many active threads (reserveThread() causes this), so it calls
enqueueTask() - which actually wakes up the waiting thread, but
it didn't decrement the number of waiting threads.

Note that tryStart() is "if I can grab a waiting thread, enqueue task and wake it"
while start(), in case tryStart() fails, wants to "enqueue, and then if I can grab
a waiting thread, wake it". This is why enqueue shouldn't wake; waking must happen
only if we can grab a thread (d->waitingThreads > 0).

Task-number: QTBUG-21051
Change-Id: I3d98337103031c9bdf0bf365295f245be0c66aa7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 13:09:46 +02:00
..
qatomicint Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qatomicpointer Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qfuture Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
qfuturesynchronizer Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qfuturewatcher Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
qmutex Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qmutexlocker Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qreadlocker Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qreadwritelock Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qresultstore Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qsemaphore Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qthread tst_qthread: fix race on "bool visited" 2013-03-29 15:16:47 +01:00
qthreadonce Remove QT_{BEGIN,END}_HEADER macro usage 2013-01-29 01:06:04 +01:00
qthreadpool QThreadPool: fix counting of waiting threads 2013-08-24 13:09:46 +02:00
qthreadstorage Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-23 22:12:54 +01:00
qwaitcondition Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qwritelocker Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
thread.pro Move QFutureSynchronizer back to QtCore 2012-09-28 23:50:10 +02:00