aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-12 11:39:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-13 10:55:55 +0200
commitdc8f0267c332e405a698545c98478756165c908e (patch)
treee012a02a183bb25ea116e693dbdb51983ca0a85f /libbuild2/context.hxx
parent7376287554e30aa0b74136bf6c16566f6bda80cd (diff)
Cache target base scope lookups
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index fbdf9b8..5cc2115 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -28,6 +28,7 @@ namespace build2
public:
// Acquire a phase lock potentially blocking (unless already in the
// desired phase) until switching to the desired phase is possible.
+ // Return false on failure.
//
bool
lock (run_phase);
@@ -38,9 +39,14 @@ namespace build2
void
unlock (run_phase);
- // Switch from one phase to another.
+ // Switch from one phase to another. Return nullopt on failure (so can be
+ // used as bool), true if switched from a different phase, and false if
+ // joined/switched to the same phase (this, for example, can be used to
+ // decide if a phase switching housekeeping is really necessary). Note:
+ // currently only implemented for the load phase (always returns true
+ // for the others).
//
- bool
+ optional<bool>
relock (run_phase unlock, run_phase lock);
// Statistics.