qt5base-lts/tests/auto/corelib
David Faure a9b6a78e54 QThreadPool: fix race at time of thread expiry.
The current synchronization mechanism was racy: decrementing waitingThreads
and then hoping that the wakeOne will wake a thread before its expiry
timeout happens. In other words, on timeout, a just-assigned task would
never run. And then no other task would run, if maxThreadCount is reached.

Fixed by using a queue of waiting threads (rather than just a count), and by
moving the wait condition into the thread itself, so we know precisely
which one we're waking up, and we can remove it from the set of waiting threads
before waking it up, and therefore it can determine on wakeup whether it
has work to do (caller removed it from the queue) or it expired (it's still
in the queue). This is reliable, whereas the return value from QWaitCondition::wait
isn't reliable, when the main thread has already decided that this thread
has work to do.

Task-number: QTBUG-3786
Change-Id: I1eac5d6c309daed7f483ac7a8074297bfda6ee32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-31 17:45:58 +01:00
..
animation don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
codecs Allow non-character codes in utf8 strings 2013-10-17 09:50:58 +02:00
global Merge remote-tracking branch 'origin/stable' into dev 2013-10-24 12:48:42 +02:00
io Merge remote-tracking branch 'origin/stable' into dev 2013-10-24 12:48:42 +02:00
itemmodels exclude gui-needing tests from -no-gui build 2013-10-18 20:05:27 +02:00
json Allow non-character codes in utf8 strings 2013-10-17 09:50:58 +02:00
kernel QSignalBlocker: (new) RAII class for QObject::blockSignals() 2013-10-30 12:56:44 +01:00
mimetypes Add QT_NO_PROCESS guards in tests where they are missing 2013-09-03 08:42:24 +02:00
plugin don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
statemachine don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
thread QThreadPool: fix race at time of thread expiry. 2013-10-31 17:45:58 +01:00
tools Merge remote-tracking branch 'origin/stable' into dev 2013-10-24 12:48:42 +02:00
xml Check for network module when building according auto tests 2013-02-19 19:20:53 +01:00
corelib.pro Import QMimeType / QMimeDatabase into QtCore. 2012-02-18 22:19:43 +01:00