From cf1670f9a6541e42f22d58e2de5940e64cb6637e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 May 2020 06:50:05 +0200 Subject: Implement ad hoc recipe sharing and locking --- libbuild2/context.hxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbuild2/context.hxx') diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index 573b8d1..8e68784 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -553,9 +553,17 @@ namespace build2 // Assuming we have a lock on the current phase, temporarily switch to a // new phase and switch back on destruction. // + // The second constructor can be used for a switch with an intermittent + // unlock: + // + // phase_unlock pu; + // phase_lock pl; + // phase_switch ps (move (pu), move (pl)); + // struct LIBBUILD2_SYMEXPORT phase_switch { - explicit phase_switch (context&, run_phase); + phase_switch (context&, run_phase); + phase_switch (phase_unlock&&, phase_lock&&); ~phase_switch () noexcept (false); run_phase old_phase, new_phase; -- cgit v1.1