diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-01 13:19:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-01 13:19:13 +0200 |
commit | aed0c46abaebd54e2df3777aaabf461c877012f7 (patch) | |
tree | d59e1909debf4bf728a33801d70ef9589e07bf86 | |
parent | e44fb9257a0e747418eda7ae254ac761147b6d65 (diff) |
Fix bug in scheduler::wait_idle()
-rw-r--r-- | build2/scheduler.cxx | 9 |
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:: |