qt5base-lts/tests/auto/corelib
Marc Mutz 494ee2aa8d QThreadPool: supersede cancel() with tryTake()
The cancel() function added in 5b11e43e for Qt 5.5 suffers from a
number of problems:

First, if runnable->autoDelete() is true, then the function suffers
from the ABA problem (see documentation written for trytake()).

Second, if runnable->autoDelete() is false, due to cancel() throwing
away crucial information instead of returning it, the caller cannot
know whether the runnable was canceled (and thus has to be deleted),
wasn't found or is currently executing (and thus mustn't be deleted),
or has finished executing (and can be used to extract the result).

Deprecate this dangerous API and replace it with the much more useful
Private::stealRunnable(), promoted to public API and renamed to
tryTake() for consistency with the rest of Qt.

Described the various caveats in the function's documentation.

[ChangeLog][QtCore][QThreadPool] The cancel() function suffers from
several subtle issues and has been replaced with a new tryTake()
function.

Change-Id: I93125935614087efa24b3e3969dd6718aeabaa4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-22 16:37:07 +00:00
..
animation Merge remote-tracking branch 'origin/5.8' into dev 2017-01-30 12:46:20 +01:00
codecs tst_utf8: remove duplicate nonCharacters() data 2017-01-10 18:39:31 +00:00
global New qfloat16 class 2017-01-31 14:21:42 +00:00
io Merge remote-tracking branch 'origin/5.8' into 5.9 2017-02-08 15:49:18 +01:00
itemmodels QIPM: Persist model indexes after emitting layoutChange, not before 2016-12-21 01:37:50 +00:00
json Merge remote-tracking branch 'origin/5.8' into dev 2016-11-17 14:43:26 +01:00
kernel QTypeInfo: don't treat enums and (extended) integral types as complex 2017-02-22 09:21:57 +00:00
mimetypes tst_QMimeDatabase: increase timeout 2017-02-14 13:51:12 +00:00
plugin Merge remote-tracking branch 'origin/5.8' into 5.9 2017-02-14 11:33:02 +01:00
statemachine Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
thread QThreadPool: supersede cancel() with tryTake() 2017-02-22 16:37:07 +00:00
tools Merge remote-tracking branch 'origin/5.8' into 5.9 2017-02-16 21:51:11 +01:00
xml tests/auto/corelib/xml: cleanup 2016-08-27 05:09:16 +00:00
corelib.pro Add support for Apple tvOS 2016-05-17 16:11:23 +00:00