summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qexception.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-02-10 11:43:57 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-02-22 16:37:07 +0000
commit494ee2aa8d063f3159f3980832808872097286d6 (patch)
treed9abe98eec4c1933787089aebb9e2a182ff74448 /src/corelib/thread/qexception.h
parentbeaf33983eeb67ed3279f4835cf94c15a5e80969 (diff)
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>
Diffstat (limited to 'src/corelib/thread/qexception.h')
0 files changed, 0 insertions, 0 deletions