| 493 | } |
| 494 | |
| 495 | void cmCTestMultiProcessHandler::LockResources(int index) |
| 496 | { |
| 497 | this->RunningCount += this->GetProcessorsUsed(index); |
| 498 | |
| 499 | auto* properties = this->Properties[index]; |
| 500 | |
| 501 | this->ProjectResourcesLocked.insert(properties->ProjectResources.begin(), |
| 502 | properties->ProjectResources.end()); |
| 503 | |
| 504 | if (properties->RunSerial) { |
| 505 | this->SerialTestRunning = true; |
| 506 | } |
| 507 | |
| 508 | if (this->HaveAffinity && properties->WantAffinity) { |
| 509 | size_t needProcessors = this->GetProcessorsUsed(index); |
| 510 | assert(needProcessors <= this->ProcessorsAvailable.size()); |
| 511 | std::vector<size_t> affinity; |
| 512 | affinity.reserve(needProcessors); |
| 513 | for (size_t i = 0; i < needProcessors; ++i) { |
| 514 | auto p = this->ProcessorsAvailable.begin(); |
| 515 | affinity.push_back(*p); |
| 516 | this->ProcessorsAvailable.erase(p); |
| 517 | } |
| 518 | properties->Affinity = std::move(affinity); |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | void cmCTestMultiProcessHandler::UnlockResources(int index) |
| 523 | { |
no test coverage detected