aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/algorithm.cxx10
-rw-r--r--libbuild2/algorithm.ixx2
2 files changed, 9 insertions, 3 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index 16a6728..e11275d 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -1117,8 +1117,10 @@ namespace build2
return ct.try_matched_state (a, false);
}
+ // Note: lock is a reference to avoid the stacking overhead.
+ //
static group_view
- resolve_members_impl (action a, const target& g, target_lock l)
+ resolve_members_impl (action a, const target& g, target_lock&& l)
{
// Note that we will be unlocked if the target is already applied.
//
@@ -1247,8 +1249,10 @@ namespace build2
return r;
}
+ // Note: lock is a reference to avoid the stacking overhead.
+ //
void
- resolve_group_impl (action a, const target& t, target_lock l)
+ resolve_group_impl (action a, const target& t, target_lock&& l)
{
pair<bool, target_state> r (
match_impl (l, true /* step */, true /* try_match */));
@@ -1262,6 +1266,8 @@ namespace build2
r.second = target_state::failed;
}
+ l.unlock ();
+
if (r.first && r.second == target_state::failed)
throw failed ();
}
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index 7c87a72..3398595 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -646,7 +646,7 @@ namespace build2
}
LIBBUILD2_SYMEXPORT void
- resolve_group_impl (action, const target&, target_lock);
+ resolve_group_impl (action, const target&, target_lock&&);
inline const target*
resolve_group (action a, const target& t)