aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-19 14:55:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-19 14:55:27 +0200
commit1434ffdba68bdf935386cde56bb2fadd0cd352d5 (patch)
tree7786186093005dbd5a42f3054c4fb70f0ae921d6 /libbuild2/context.ixx
parentb75ff8cd5c2ac1a1bd88ddf513f3a07a570eafcf (diff)
Minor cleanups
Diffstat (limited to 'libbuild2/context.ixx')
-rw-r--r--libbuild2/context.ixx32
1 files changed, 32 insertions, 0 deletions
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);
+ }
}