From ac838a3c051e8f15514f0454b060d00695b372f7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Apr 2019 10:33:59 +0200 Subject: Add dry-run support to test rules --- build2/context.ixx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'build2/context.ixx') diff --git a/build2/context.ixx b/build2/context.ixx index 62f3d81..1c25922 100644 --- a/build2/context.ixx +++ b/build2/context.ixx @@ -7,6 +7,12 @@ namespace build2 // wait_guard // inline wait_guard:: + wait_guard () + : start_count (0), task_count (nullptr), phase (false) + { + } + + inline wait_guard:: wait_guard (atomic_count& tc, bool p) : wait_guard (0, tc, p) { @@ -25,6 +31,25 @@ namespace build2 wait (); } + inline wait_guard:: + wait_guard (wait_guard&& x) + : start_count (x.start_count), task_count (x.task_count), phase (x.phase) + { + x.task_count = nullptr; + } + + inline wait_guard& wait_guard:: + operator= (wait_guard&& x) + { + if (&x != this) + { + assert (task_count == nullptr); + start_count = x.start_count; task_count = x.task_count; phase = x.phase; + x.task_count = nullptr; + } + return *this; + } + inline void wait_guard:: wait () { -- cgit v1.1