From 1434ffdba68bdf935386cde56bb2fadd0cd352d5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 19 Aug 2019 14:55:27 +0200 Subject: Minor cleanups --- libbuild2/context.ixx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'libbuild2/context.ixx') diff --git a/libbuild2/context.ixx b/libbuild2/context.ixx index f947bd7..1364eb8 100644 --- a/libbuild2/context.ixx +++ b/libbuild2/context.ixx @@ -57,4 +57,36 @@ namespace build2 sched.wait (start_count, *task_count); task_count = nullptr; } + + inline void + set_current_mif (const meta_operation_info& mif) + { + if (current_mname != mif.name) + { + current_mname = mif.name; + global_scope->rw ().assign (var_build_meta_operation) = mif.name; + } + + current_mif = &mif; + current_on = 0; // Reset. + } + + inline void + set_current_oif (const operation_info& inner_oif, + const operation_info* outer_oif, + bool diag_noise) + { + current_oname = (outer_oif == nullptr ? inner_oif : *outer_oif).name; + current_inner_oif = &inner_oif; + current_outer_oif = outer_oif; + current_on++; + current_mode = inner_oif.mode; + current_diag_noise = diag_noise; + + // Reset counters (serial execution). + // + dependency_count.store (0, memory_order_relaxed); + target_count.store (0, memory_order_relaxed); + skip_count.store (0, memory_order_relaxed); + } } -- cgit v1.1