aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-01 13:19:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-01-01 13:19:13 +0200
commitaed0c46abaebd54e2df3777aaabf461c877012f7 (patch)
treed59e1909debf4bf728a33801d70ef9589e07bf86
parente44fb9257a0e747418eda7ae254ac761147b6d65 (diff)
Fix bug in scheduler::wait_idle()
-rw-r--r--build2/scheduler.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx
index fa46dbe..cd621bc 100644
--- a/build2/scheduler.cxx
+++ b/build2/scheduler.cxx
@@ -191,16 +191,15 @@ namespace build2
{
lock l (mutex_);
- while (active_ != init_active_)
+ assert (waiting_ == 0);
+ assert (ready_ == 0);
+
+ while (active_ != init_active_ || starting_ != 0)
{
l.unlock ();
this_thread::yield ();
l.lock ();
}
-
- assert (waiting_ == 0);
- assert (ready_ == 0);
- assert (starting_ == 0);
}
size_t scheduler::