MCPcopy Create free account
hub / github.com/VCVRack/Rack / start

Method start

src/engine/Engine.cpp:171–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 bool running = false;
170
171 void start() {
172 if (running) {
173 WARN("Engine worker already started");
174 return;
175 }
176 running = true;
177
178 // Launch thread with same scheduling policy and priority as current thread (ID 0)
179 int err;
180 err = pthread_create(&thread, NULL, [](void* p) -> void* {
181 EngineWorker* that = (EngineWorker*) p;
182
183 // int policy;
184 // sched_param param;
185 // if (!pthread_getschedparam(pthread_self(), &policy, &param)) {
186 // DEBUG("EngineWorker %d thread launched with policy %d priority %d", that->id, policy, param.sched_priority);
187 // }
188
189 that->run();
190 return NULL;
191 }, this);
192 if (err) {
193 WARN("EngineWorker %d thread could not be started: %s", id, strerror(err));
194 }
195 }
196
197 void requestStop() {
198 running = false;

Callers 1

Engine_relaunchWorkersFunction · 0.80

Calls 1

runMethod · 0.45

Tested by

no test coverage detected