aboutsummaryrefslogtreecommitdiff
path: root/build2/target.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-10 08:15:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commitabccaf9596461215fce0e32322133fb6c39be44f (patch)
tree3fc16a6e6142d65e6b47ae686ab845cc164478cc /build2/target.ixx
parentbcb2a89e111a918a48a132a2a29e0c26d724591d (diff)
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.
Diffstat (limited to 'build2/target.ixx')
-rw-r--r--build2/target.ixx35
1 files changed, 23 insertions, 12 deletions
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::