diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-03-09 11:13:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-03-09 11:13:05 +0200 |
commit | 145589cf2b524b59a8ffa950882d3433e2885b7c (patch) | |
tree | f3db3dee01d39e72f7033171c34d1fe7403da490 /libbuild2/algorithm.ixx | |
parent | 2e6c3bf33ab1cd75b9936e65568a39571f279fc3 (diff) |
Rename execute_wait() to execute()
The old half-way semantics of execute() wasn't useful.
Diffstat (limited to 'libbuild2/algorithm.ixx')
-rw-r--r-- | libbuild2/algorithm.ixx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx index 29a4b59..c57e117 100644 --- a/libbuild2/algorithm.ixx +++ b/libbuild2/algorithm.ixx @@ -680,22 +680,23 @@ namespace build2 execute (action, const target&, size_t, atomic_count*); inline target_state - execute (action a, const target& t) + execute (action a, const target& t, bool fail) { - return execute (a, t, 0, nullptr); - } - - inline target_state - execute_wait (action a, const target& t) - { - //@@ redo + target_state r (execute (a, t, 0, nullptr)); - if (execute (a, t) == target_state::busy) + if (r == target_state::busy) + { t.ctx.sched.wait (t.ctx.count_executed (), t[a].task_count, scheduler::work_none); - return t.executed_state (a); + r = t.executed_state (a, false); + } + + if (r == target_state::failed && fail) + throw failed (); + + return r; } inline target_state @@ -757,7 +758,7 @@ namespace build2 execute_inner (action a, const target& t) { assert (a.outer ()); - return execute_wait (a.inner_action (), t); + return execute (a.inner_action (), t); } inline target_state |