diff options
Diffstat (limited to 'src/libstore/build/substitution-goal.cc')
-rw-r--r-- | src/libstore/build/substitution-goal.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc index fb2949fd0..67a5f20bb 100644 --- a/src/libstore/build/substitution-goal.cc +++ b/src/libstore/build/substitution-goal.cc @@ -152,15 +152,16 @@ Goal::WorkResult PathSubstitutionGoal::tryNext() /* To maintain the closure invariant, we first have to realise the paths referenced by this one. */ + WaitForGoals result; for (auto & i : info->references) if (i != storePath) /* ignore self-references */ - addWaitee(worker.makePathSubstitutionGoal(i)); + result.goals.insert(worker.makePathSubstitutionGoal(i)); - if (waitees.empty()) {/* to prevent hang (no wake-up event) */ + if (result.goals.empty()) {/* to prevent hang (no wake-up event) */ return referencesValid(); } else { state = &PathSubstitutionGoal::referencesValid; - return StillAlive{}; + return result; } } @@ -181,8 +182,7 @@ Goal::WorkResult PathSubstitutionGoal::referencesValid() assert(worker.store.isValidPath(i)); state = &PathSubstitutionGoal::tryToRun; - worker.wakeUp(shared_from_this()); - return StillAlive{}; + return ContinueImmediately{}; } @@ -194,8 +194,7 @@ Goal::WorkResult PathSubstitutionGoal::tryToRun() if maxSubstitutionJobs == 0, we still allow a substituter to run. This prevents infinite waiting. */ if (worker.getNrSubstitutions() >= std::max(1U, (unsigned int) settings.maxSubstitutionJobs)) { - worker.waitForBuildSlot(shared_from_this()); - return StillAlive{}; + return WaitForSlot{}; } maintainRunningSubstitutions = std::make_unique<MaintainCount<uint64_t>>(worker.runningSubstitutions); @@ -256,8 +255,7 @@ Goal::WorkResult PathSubstitutionGoal::finished() /* Try the next substitute. */ state = &PathSubstitutionGoal::tryNext; - worker.wakeUp(shared_from_this()); - return StillAlive{}; + return ContinueImmediately{}; } worker.markContentsGood(storePath); |