| 69 | } |
| 70 | |
| 71 | wxThread::ExitCode FluxEngineApp::Entry() |
| 72 | { |
| 73 | try |
| 74 | { |
| 75 | if (_callback) |
| 76 | _callback(); |
| 77 | } |
| 78 | catch (const ErrorException& e) |
| 79 | { |
| 80 | log(ErrorLogMessage{e.message + '\n'}); |
| 81 | } |
| 82 | catch (const EmergencyStopException& e) |
| 83 | { |
| 84 | log(EmergencyStopMessage()); |
| 85 | } |
| 86 | |
| 87 | postToUiThread( |
| 88 | [&] |
| 89 | { |
| 90 | GetThread()->Wait(); |
| 91 | |
| 92 | _callback = nullptr; |
| 93 | SendUpdateEvent(); |
| 94 | }); |
| 95 | return 0; |
| 96 | } |
| 97 | |
| 98 | void FluxEngineApp::RunOnWorkerThread(std::function<void()> callback) |
| 99 | { |
nothing calls this directly
no test coverage detected