diff options
author | Brad King <brad.king@kitware.com> | 2023-11-01 20:48:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-17 23:41:41 (GMT) |
commit | 451429e19c235cb2200be1c7aba3f6b29f389857 (patch) | |
tree | 196c058a198f4ae4277ba1ea75d99b6fb38264bf | |
parent | 419443f68f8d1942cedab04777a5d2e7a0caccd8 (diff) | |
download | CMake-451429e19c235cb2200be1c7aba3f6b29f389857.zip CMake-451429e19c235cb2200be1c7aba3f6b29f389857.tar.gz CMake-451429e19c235cb2200be1c7aba3f6b29f389857.tar.bz2 |
cmCTestMultiProcessHandler: Use cm::uv_loop_ptr abstraction
This ensures all loop resources are released.
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index d71a34d..c4e3759 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -142,10 +142,10 @@ void cmCTestMultiProcessHandler::RunTests() #endif this->TestHandler->SetMaxIndex(this->FindMaxIndex()); - uv_loop_init(&this->Loop); + this->Loop.init(); this->StartNextTests(); - uv_run(&this->Loop, UV_RUN_DEFAULT); - uv_loop_close(&this->Loop); + uv_run(this->Loop, UV_RUN_DEFAULT); + this->Loop.reset(); if (!this->StopTimePassed && !this->CheckStopOnFailure()) { assert(this->Complete()); @@ -618,7 +618,7 @@ void cmCTestMultiProcessHandler::StartNextTests() milliseconds = 10; } if (this->TestLoadRetryTimer.get() == nullptr) { - this->TestLoadRetryTimer.init(this->Loop, this); + this->TestLoadRetryTimer.init(*this->Loop, this); } this->TestLoadRetryTimer.start( &cmCTestMultiProcessHandler::OnTestLoadRetryCB, milliseconds, 0); diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index a002bcc..8c118a6 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -201,7 +201,7 @@ protected: size_t ParallelLevel; // max number of process that can be run at once unsigned long TestLoad; unsigned long FakeLoadForTesting; - uv_loop_t Loop; + cm::uv_loop_ptr Loop; cm::uv_timer_ptr TestLoadRetryTimer; cmCTestTestHandler* TestHandler; cmCTest* CTest; diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index d6b6d41..4b97365 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -25,6 +25,7 @@ #include "cmProcess.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmUVHandlePtr.h" #include "cmWorkingDirectory.h" cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler, @@ -890,7 +891,7 @@ bool cmCTestRunTest::ForkProcess() this->TestResult.Environment.erase(this->TestResult.Environment.length() - 1); - return this->TestProcess->StartProcess(this->MultiTestHandler.Loop, + return this->TestProcess->StartProcess(*this->MultiTestHandler.Loop, &this->TestProperties->Affinity); } |