aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-02-26 09:14:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-02-26 09:14:37 +0200
commit4a2a3bd5033744c31377d31ca54be00622280a1b (patch)
tree616cc10d585dd40ab252f02b55ff44c694c18fb4 /libbuild2/context.hxx
parent75cedf46dba58e94b55678dc64bd4f77e23de5cd (diff)
Add ability to request serialization from scheduler
In particular, this can be used to make sure no other recipe is being executed in parallel with the caller.
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index 2dec54a..33fc892 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -849,14 +849,20 @@ namespace build2
//
struct LIBBUILD2_SYMEXPORT phase_unlock
{
- phase_unlock (context&, bool unlock = true, bool delay = false);
+ explicit phase_unlock (context*, bool delay = false);
+ explicit phase_unlock (context& ctx, bool delay = false)
+ : phase_unlock (&ctx, delay) {}
+
~phase_unlock () noexcept (false);
void
unlock ();
+ void
+ lock ();
+
context* ctx;
- phase_lock* lock;
+ phase_lock* lock_;
};
// Assuming we have a lock on the current phase, temporarily switch to a