Keep track of how many threads are waiting

This commit is contained in:
Eelco Dolstra
2015-07-10 19:10:14 +02:00
parent 06d75699a7
commit 3ded87329d
4 changed files with 7 additions and 2 deletions

View File

@@ -179,9 +179,11 @@ void State::buildRemote(std::shared_ptr<StoreAPI> store,
/* Copy the input closure. */
if (machine->sshName != "localhost") {
printMsg(lvlDebug, format("sending closure of %1% to %2%") % step->drvPath % machine->sshName);
MaintainCount mc(nrStepsCopyingTo);
auto mc1 = std::make_shared<MaintainCount>(nrStepsWaiting);
std::lock_guard<std::mutex> sendLock(machine->state->sendLock);
mc1.reset();
MaintainCount mc2(nrStepsCopyingTo);
printMsg(lvlDebug, format("sending closure of %1% to %2%") % step->drvPath % machine->sshName);
copyClosureTo(store, from, to, inputs, bytesSent);
}