MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / queueRecomputeRequest

Method queueRecomputeRequest

src/App/Application.cpp:847–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845}
846
847void Application::queueRecomputeRequest(RecomputeRequest req)
848{
849 if (!canRecomputeRequestOnWorker(req)) {
850 RecomputeResult result;
851
852 // Requests that are not worker-safe stay on the caller thread unless a
853 // GUI main-thread hop is required. In App-only/headless mode there are
854 // no GUI hooks, so processing inline preserves the "stay off the
855 // worker" guarantee without inventing a synthetic main thread.
856 if (App::MainThreadSignalConfig::hasHooks()
857 && !App::MainThreadSignalConfig::isMainThread()) {
858 App::MainThreadSignalConfig::invoke(
859 [&req, &result]() { result = processRecomputeRequest(req); },
860 /*blocking=*/true
861 );
862 }
863 else {
864 result = processRecomputeRequest(req);
865 }
866
867 if (req.callback) {
868 req.callback(req, result);
869 }
870 return;
871 }
872
873 {
874 std::lock_guard<std::mutex> lock(_recomputeMutex);
875 _recomputeRequests.push_back(std::move(req));
876 }
877 notifyRecomputeWorker();
878}
879
880void Application::cancelRecomputeRequestsForDocument(const std::string& documentName)
881{

Callers 3

activatedMethod · 0.80
TEST_FFunction · 0.80

Calls 4

processRecomputeRequestFunction · 0.85
moveFunction · 0.50
callbackMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected