aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-06 10:43:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commit74d54ca37f8e16abb93b35617b6121ae19cc8028 (patch)
treea4c86c0d84c301aad16108a10e224b78fe2c8236
parent0e4b975073a787ce3e5450173cf407a71bafd3a4 (diff)
Make scheduler::resume() call usable in serial execution
-rw-r--r--build2/scheduler.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx
index d1fdf26..013bbbc 100644
--- a/build2/scheduler.cxx
+++ b/build2/scheduler.cxx
@@ -16,6 +16,8 @@ namespace build2
if (task_count <= start_count)
return;
+ assert (max_active_ != 1); // Serial execution, nobody to wait for.
+
// See if we can run some of our own tasks.
//
// If we are waiting on someone else's task count then there migh still
@@ -121,6 +123,9 @@ namespace build2
void scheduler::
resume (atomic_count& tc)
{
+ if (max_active_ == 1) // Serial execution, nobody to wakeup.
+ return;
+
wait_slot& s (
wait_queue_[std::hash<atomic_count*> () (&tc) % wait_queue_size_]);