From dc8f0267c332e405a698545c98478756165c908e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Apr 2022 11:39:55 +0200 Subject: Cache target base scope lookups --- libbuild2/context.hxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libbuild2/context.hxx') 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 relock (run_phase unlock, run_phase lock); // Statistics. -- cgit v1.1