aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-12-11 07:07:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-12-11 07:07:36 +0200
commit3074c5e1409ad49c0793db6384ecbc6ac4ed33a9 (patch)
tree256d707b43c3139fc7591d7ebd2a6c85456bc90b /libbuild2/algorithm.hxx
parentb971493841a601041cac1f680e3828e8d223e6f2 (diff)
Add search_locked() versions of search() functions
Diffstat (limited to 'libbuild2/algorithm.hxx')
-rw-r--r--libbuild2/algorithm.hxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/libbuild2/algorithm.hxx b/libbuild2/algorithm.hxx
index 34e844c..aa1336c 100644
--- a/libbuild2/algorithm.hxx
+++ b/libbuild2/algorithm.hxx
@@ -39,6 +39,12 @@ namespace build2
LIBBUILD2_SYMEXPORT const target&
search (const target&, const prerequisite_key&);
+ // As above but return the lock if the target was newly created. Note that
+ // this version can only be used on project-unqualified prerequisites.
+ //
+ LIBBUILD2_SYMEXPORT pair<target&, ulock>
+ search_locked (const target&, const prerequisite_key&);
+
// Note that unlike the above version, this one can be called during the
// load and execute phases.
//
@@ -57,6 +63,9 @@ namespace build2
const target&
search (const target&, const target_type&, const prerequisite_key&);
+ pair<target&, ulock>
+ search_locked (const target&, const target_type&, const prerequisite_key&);
+
// As above but specify the prerequisite to search as individual key
// components. Scope can be NULL if the directory is absolute.
//
@@ -70,6 +79,15 @@ namespace build2
const scope* = nullptr, // NULL means dir is absolute.
const optional<project_name>& proj = nullopt);
+ pair<target&, ulock>
+ search_locked (const target&,
+ const target_type&,
+ const dir_path& dir,
+ const dir_path& out,
+ const string& name,
+ const string* ext = nullptr, // NULL means unspecified.
+ const scope* = nullptr); // NULL means dir is absolute.
+
const target*
search_existing (context&,
const target_type&,