aboutsummaryrefslogtreecommitdiff
path: root/build2/scheduler.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-27 18:40:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-27 18:40:52 +0200
commit566bcb8c4c36d12e398f00349c5f27cae06fa7a9 (patch)
treed7090693a6f13cf4995a24724675faa8a5582296 /build2/scheduler.cxx
parentd14d3123c7cdb53a635d4be55902c09a410c28cc (diff)
Implement displaying build progress (--progress|-p)
Diffstat (limited to 'build2/scheduler.cxx')
-rw-r--r--build2/scheduler.cxx11
1 files changed, 11 insertions, 0 deletions
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<size_t (size_t)> 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)
{