aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-05-15 06:50:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 08:35:29 +0200
commitcf1670f9a6541e42f22d58e2de5940e64cb6637e (patch)
treeefb80b4b34d447b2f36658c7f1a6a70d47547f5b /libbuild2/context.cxx
parent3861606766939fffd3bf110420e377bf194e02b7 (diff)
Implement ad hoc recipe sharing and locking
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r--libbuild2/context.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index fe046ae..a3455ea 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -894,6 +894,14 @@ namespace build2
}
phase_switch::
+ phase_switch (phase_unlock&& u, phase_lock&& l)
+ : old_phase (u.l->phase), new_phase (l.phase)
+ {
+ phase_lock_instance = u.l; // Disarms phase_lock
+ u.l = nullptr; // Disarms phase_unlock
+ }
+
+ phase_switch::
~phase_switch () noexcept (false)
{
phase_lock* pl (phase_lock_instance);