summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qfutureinterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qfutureinterface.h')
-rw-r--r--src/corelib/thread/qfutureinterface.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h
index ecc31d6ec3..e813031d59 100644
--- a/src/corelib/thread/qfutureinterface.h
+++ b/src/corelib/thread/qfutureinterface.h
@@ -154,6 +154,8 @@ public:
int loadState() const;
void cancel();
+ void cancelAndFinish() { cancel(CancelMode::CancelAndFinish); }
+
void setSuspended(bool suspend);
void toggleSuspended();
void reportSuspended() const;
@@ -216,6 +218,9 @@ protected:
bool launchAsync() const;
bool isRunningOrPending() const;
+
+ enum class CancelMode { CancelOnly, CancelAndFinish };
+ void cancel(CancelMode mode);
};
inline void swap(QFutureInterfaceBase &lhs, QFutureInterfaceBase &rhs) noexcept