diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-04-28 08:48:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-27 15:47:28 +0200 |
commit | b808c255b6a9ddba085bf5646e7d20ec344f2e2d (patch) | |
tree | 32730291f7e6de8ef0a227905520dd66fb4ec0f3 /libbuild2/context.hxx | |
parent | 3552356a87402727e663131994fa87f48b3cd4fb (diff) |
Initial support for ad hoc recipes (still work in progress)
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r-- | libbuild2/context.hxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index 573b8d1..2a9c93e 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -428,7 +428,7 @@ namespace build2 // const loaded_modules_lock* modules_lock; - // Nested context for updating build system modules. + // Nested context for updating build system modules and ad hoc recipes. // // Note that such a context itself should normally have modules_context // setup to point to itself (see import_module() for details). @@ -438,9 +438,10 @@ namespace build2 public: // If module_context is absent, then automatic updating of build system - // modules is disabled. If it is NULL, then the context will be created - // lazily if and when necessary. Otherwise, it should be a properly setup - // context (including, normally, a self-reference in modules_context). + // modules and ad hoc recipes is disabled. If it is NULL, then the context + // will be created lazily if and when necessary. Otherwise, it should be a + // properly setup context (including, normally, a self-reference in + // modules_context). // explicit context (scheduler&, @@ -553,9 +554,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; |