MCPcopy Create free account
hub / github.com/Kitware/CMake / LockResources

Method LockResources

Source/CTest/cmCTestMultiProcessHandler.cxx:495–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void 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
522void cmCTestMultiProcessHandler::UnlockResources(int index)
523{

Callers 1

StartNextTestsMethod · 0.95

Calls 9

GetProcessorsUsedMethod · 0.95
moveFunction · 0.85
reserveMethod · 0.80
push_backMethod · 0.80
eraseMethod · 0.80
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected