various: added hooks so that various lengthy functions could be cancelled from another thread

This commit is contained in:
itsmattkc
2020-02-17 02:10:12 +11:00
parent fd49b6eb55
commit 22046535ca
25 changed files with 208 additions and 80 deletions
+1
View File
@@ -18,6 +18,7 @@ set(OLIVE_SOURCES
${OLIVE_SOURCES}
common/bezier.h
common/bezier.cpp
common/cancelableobject.h
common/channellayout.h
common/clamp.h
common/constructors.h
+26
View File
@@ -0,0 +1,26 @@
#ifndef CANCELABLEOBJECT_H
#define CANCELABLEOBJECT_H
#include <QAtomicInt>
class CancelableObject {
public:
CancelableObject() :
cancelled_(false)
{
}
void Cancel() {
cancelled_ = true;
}
const QAtomicInt& IsCancelled() const {
return cancelled_;
}
private:
QAtomicInt cancelled_;
};
#endif // CANCELABLEOBJECT_H