aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx10
1 files changed, 9 insertions, 1 deletions
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;