diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-15 06:50:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-27 08:35:29 +0200 |
commit | cf1670f9a6541e42f22d58e2de5940e64cb6637e (patch) | |
tree | efb80b4b34d447b2f36658c7f1a6a70d47547f5b /libbuild2/context.hxx | |
parent | 3861606766939fffd3bf110420e377bf194e02b7 (diff) |
Implement ad hoc recipe sharing and locking
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r-- | libbuild2/context.hxx | 10 |
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; |