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.cc | |
parent | 80290e7d65dc498e9ea5e64aa6cbc65282072deb (diff) |
Add .so target. Fix ready state checks.
Diffstat (limited to 'task.cc')
-rw-r--r-- | task.cc | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -39,32 +39,38 @@ bool Task::ready() { for(const auto& task : dependsTasks) { - if(task->dirty() && !task->done()) + if(task->dirty() || task->state() == State::Running) { return false; } } + task_state.store(State::Ready); return true; } int Task::run() { - if(is_done.load()) + if(task_state.load() == State::Done) { return 0; } + task_state.store(State::Running); auto ret = runInner(); if(ret == 0) { - is_done.store(true); + task_state.store(State::Done); + } + else + { + task_state.store(State::Error); } return ret; } -bool Task::done() const +State Task::state() const { - return is_done.load(); + return task_state.load(); } |