qt5base-lts/tests/auto
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
..
android Updated license headers 2016-01-21 18:55:18 +00:00
bic/data Binary compatibility files for QtBase (5.8.0) 2017-02-14 12:42:20 +00:00
cmake CMake: Create a Qt5::<ModuleName>Private target for each module 2016-12-23 19:24:35 +00:00
compilerwarnings/data Updated license headers 2016-01-21 18:55:18 +00:00
concurrent Merge remote-tracking branch 'origin/5.6' into 5.7 2016-08-25 16:12:11 +02:00
corelib QThreadPool: supersede cancel() with tryTake() 2017-02-22 16:37:07 +00:00
dbus Plug leaks in tests/auto/dbus 2017-01-26 10:33:28 +00:00
gui Don't create platform window for QWindows when calling setVisible(false) 2017-02-13 18:30:06 +00:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network Fix http2 auto-test 2017-02-15 14:11:19 +00:00
opengl Add support for OpenGL 3.2+ core profile contexts in QPainter 2017-01-23 11:34:05 +00:00
other Merge remote-tracking branch 'origin/5.8' into dev 2017-01-25 20:06:06 +01:00
printsupport Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
shared Make self-contained test of condensed font matching and width 2016-10-16 00:11:13 +00:00
sql tst_qsqlquery.cpp: Refactor runIntegralTypesMysqlTest() 2016-12-05 12:06:39 +00:00
testlib Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
tools moc: error out when the Q_PLUGIN_METADATA file can't be opened 2017-02-10 06:55:48 +00:00
widgets Widgets: Update micro focus in QLineEdit and friends 2017-02-17 17:09:50 +00:00
xml Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
auto.pro Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
network-settings.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00