diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-06-19 09:18:26 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-06-19 09:18:26 +0200 |
commit | a2be8eba3aaf11a9a73092793d27d6d46b4270cd (patch) | |
tree | ec8d463fe0537785337b4632e0c59bc1185b68dc /task.h | |
parent | 80290e7d65dc498e9ea5e64aa6cbc65282072deb (diff) |
Add .so target. Fix ready state checks.
Diffstat (limited to 'task.h')
-rw-r--r-- | task.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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; } |