aboutsummaryrefslogtreecommitdiff
path: root/include/AsyncTask.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/AsyncTask.hpp')
-rw-r--r--include/AsyncTask.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/AsyncTask.hpp b/include/AsyncTask.hpp
index 0d9c453..abdc0f8 100644
--- a/include/AsyncTask.hpp
+++ b/include/AsyncTask.hpp
@@ -26,6 +26,19 @@ namespace QuickMedia {
return *this;
}
+ AsyncTask(AsyncTask &&other) {
+ cancel();
+ thread = std::move(other.thread);
+ future = std::move(other.future);
+ }
+
+ AsyncTask& operator=(AsyncTask &&other) {
+ cancel();
+ thread = std::move(other.thread);
+ future = std::move(other.future);
+ return *this;
+ }
+
~AsyncTask() {
cancel();
}