aboutsummaryrefslogtreecommitdiff
path: root/build2/context.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/context.ixx')
-rw-r--r--build2/context.ixx25
1 files changed, 25 insertions, 0 deletions
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 ()
{