From 566bcb8c4c36d12e398f00349c5f27cae06fa7a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Jul 2017 18:40:52 +0200 Subject: Implement displaying build progress (--progress|-p) --- build2/scheduler.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'build2/scheduler.cxx') diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx index fdf4121..65684eb 100644 --- a/build2/scheduler.cxx +++ b/build2/scheduler.cxx @@ -388,6 +388,17 @@ namespace build2 return r; } + scheduler::monitor_guard scheduler:: + monitor (atomic_count& c, size_t t, function f) + { + assert (monitor_count_ == nullptr && t != 0); + monitor_count_ = &c; + monitor_tshold_.store (t, memory_order_relaxed); + monitor_init_ = c.load (memory_order_relaxed); + monitor_func_ = move (f); + return monitor_guard (this); + } + void scheduler:: activate_helper (lock& l) { -- cgit v1.1