From be773edfa2c8f8f3230509bbd713542d20fbb37e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Feb 2017 08:02:57 +0200 Subject: Use const scheduler task count where appropriate --- build2/scheduler.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build2/scheduler.cxx') diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx index 013bbbc..edfa02c 100644 --- a/build2/scheduler.cxx +++ b/build2/scheduler.cxx @@ -11,7 +11,7 @@ using namespace std; namespace build2 { void scheduler:: - wait (size_t start_count, atomic_count& task_count) + wait (size_t start_count, const atomic_count& task_count) { if (task_count <= start_count) return; @@ -39,10 +39,10 @@ namespace build2 } void scheduler:: - suspend (size_t start_count, atomic_count& tc) + suspend (size_t start_count, const atomic_count& tc) { wait_slot& s ( - wait_queue_[std::hash () (&tc) % wait_queue_size_]); + wait_queue_[std::hash () (&tc) % wait_queue_size_]); // This thread is no longer active. // @@ -121,13 +121,13 @@ namespace build2 } void scheduler:: - resume (atomic_count& tc) + resume (const atomic_count& tc) { if (max_active_ == 1) // Serial execution, nobody to wakeup. return; wait_slot& s ( - wait_queue_[std::hash () (&tc) % wait_queue_size_]); + wait_queue_[std::hash () (&tc) % wait_queue_size_]); // See suspend() for why we must hold the lock. // -- cgit v1.1