summaryrefslogtreecommitdiff
path: root/task.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-19 09:18:26 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-19 09:18:26 +0200
commita2be8eba3aaf11a9a73092793d27d6d46b4270cd (patch)
treeec8d463fe0537785337b4632e0c59bc1185b68dc /task.h
parent80290e7d65dc498e9ea5e64aa6cbc65282072deb (diff)
Add .so target. Fix ready state checks.
Diffstat (limited to 'task.h')
-rw-r--r--task.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/task.h b/task.h
index 2dd05e3..00b01d2 100644
--- a/task.h
+++ b/task.h
@@ -7,6 +7,15 @@
#include <list>
#include <memory>
+enum class State
+{
+ Unknown,
+ Ready,
+ Running,
+ Done,
+ Error,
+};
+
class Task
{
public:
@@ -17,13 +26,13 @@ public:
bool dirty();
bool ready();
int run();
- bool done() const;
+ State state() const;
virtual int clean() = 0 ;
virtual std::vector<std::string> depends() const = 0;
virtual std::string target() const = 0;
protected:
- std::atomic<bool> is_done{false};
+ std::atomic<State> task_state{State::Unknown};
virtual int runInner() { return 0; };
virtual bool dirtyInner() { return false; }