summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qfutureinterface.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2021-11-10 09:36:26 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2021-11-13 18:13:08 +0100
commiteab40726be98616b7edac3a600e97b39fc6227cd (patch)
tree4c20257196c01d3152c0ff71d737bd6041a2dd38 /src/corelib/thread/qfutureinterface.h
parent746644a5a9631896452ec44ff7e1ffc80064b848 (diff)
QFuture: support cancellation of continuation chain through parent
This change allows canceling the chain of continuations attached to a future through canceling the future itself at any point of execution of the chain. [ChangeLog][QtCore][Important Behavior Changes] The chain of continuations attached to a future now can be cancelled through cancelling the future itself at any point of the execution of the chain, as it was documented. Previously canceling the future would cancel the chain only if it was done before the chain starts executing, otherwise the cancellation would be ignored. Now the part of the chain that wasn't started at the moment of cancellation will be canceled. Task-number: QTBUG-97582 Change-Id: I4c3b3c68e34d3a044243ac9a7a9ed3c38b7cb02e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/thread/qfutureinterface.h')
-rw-r--r--src/corelib/thread/qfutureinterface.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h
index e813031d594..3130c914203 100644
--- a/src/corelib/thread/qfutureinterface.h
+++ b/src/corelib/thread/qfutureinterface.h
@@ -182,6 +182,8 @@ public:
template<typename T>
static QFutureInterfaceBase get(const QFuture<T> &future); // implemented in qfuture.h
+ bool isChainCanceled() const;
+
protected:
// ### Qt 7: remove const from refT/derefT
bool refT() const noexcept;
@@ -212,6 +214,8 @@ private:
protected:
void setContinuation(std::function<void(const QFutureInterfaceBase &)> func);
+ void setContinuation(std::function<void(const QFutureInterfaceBase &)> func,
+ QFutureInterfaceBasePrivate *continuationFutureData);
void runContinuation() const;
void setLaunchAsync(bool value);