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

Method StartJob

Tests/CMakeLib/testUVJobServerClient.cxx:99–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 }
98
99 void StartJob(std::size_t index)
100 {
101 cm::uv_timer_ptr& job = this->Jobs[index].Timer;
102 job.init(*this->Loop, this);
103 uv_timer_start(
104 job,
105 [](uv_timer_t* handle) {
106 uv_timer_stop(handle);
107 auto self = static_cast<JobRunner*>(handle->data);
108 self->FinishJob();
109 },
110 /*timeout_ms=*/10 * (1 + (index % 3)), /*repeat_ms=*/0);
111 ++this->ActiveJobs;
112 std::cerr << " StartJob(" << index
113 << "): Active jobs: " << this->ActiveJobs << '\n';
114
115 if (this->ActiveJobs > kTOTAL_TOKENS) {
116 std::cerr << "Started more than " << kTOTAL_TOKENS << " jobs at once!\n";
117 this->Okay = false;
118 return;
119 }
120 }
121
122 void QueueJob(std::size_t index)
123 {

Callers 1

StartQueuedJobMethod · 0.95

Calls 4

FinishJobMethod · 0.95
uv_timer_startFunction · 0.85
uv_timer_stopFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected