MCPcopy Create free account
hub / github.com/chrxh/alien / runThreadLoop

Method runThreadLoop

source/EngineImpl/EngineWorker.cpp:450–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450void EngineWorker::runThreadLoop()
451{
452 try {
453 std::mutex mutexForLoop;
454 std::unique_lock<std::mutex> lockForLoop(mutexForLoop);
455
456 while (!_isShutdown.load()) {
457
458 if (!_syncSimulationWithRendering && _accessState == 0) {
459 if (_isSimulationRunning.load()) {
460 _simulationCudaFacade->calcTimestep(1, false);
461 }
462 measureTPS();
463 slowdownTPS();
464 }
465
466 processJobs();
467
468 if (_accessState == 1) {
469 _accessState = 2;
470 }
471 }
472 } catch (std::exception const& e) {
473 std::unique_lock<std::mutex> uniqueLock(_exceptionData.mutex);
474 _exceptionData.errorMessage = e.what();
475 }
476}
477
478void EngineWorker::runSimulation()
479{

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected