From abccaf9596461215fce0e32322133fb6c39be44f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Feb 2017 08:15:48 +0200 Subject: Implement parallel error propagation, keep_going mode Keep going is the default but there is now the -s|--serial-stop that makes the driver run serially and stop at first error. Also fix some lockups, other minor improvements/features. --- build2/target.ixx | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'build2/target.ixx') diff --git a/build2/target.ixx b/build2/target.ixx index a097e39..b73acd7 100644 --- a/build2/target.ixx +++ b/build2/target.ixx @@ -26,18 +26,7 @@ namespace build2 } inline target_state target:: - atomic_state () const - { - switch (task_count) - { - case target::count_unexecuted: return target_state::unknown; - case target::count_executed: return synchronized_state (); - default: return target_state::busy; - } - } - - inline target_state target:: - synchronized_state () const + state () const { // We go an extra step and short-circuit to the target state even if the // raw state is not group provided the recipe is group_recipe. @@ -57,6 +46,28 @@ namespace build2 return state_; } + inline target_state target:: + synchronized_state (bool fail) const + { + target_state r (state ()); + + if (fail && r == target_state::failed) + throw failed (); + + return r; + } + + inline target_state target:: + atomic_state (bool fail) const + { + switch (task_count) + { + case target::count_unexecuted: return target_state::unknown; + case target::count_executed: return synchronized_state (fail); + default: return target_state::busy; + } + } + // prerequisite_member // inline prerequisite prerequisite_member:: -- cgit v1.1