Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpPathfinder.cpp
Show First 20 Lines • Show All 488 Lines • ▼ Show 20 Lines | ||||||||||
} | } | |||||||||
void CCmpPathfinder::SendRequestedPaths() | void CCmpPathfinder::SendRequestedPaths() | |||||||||
{ | { | |||||||||
PROFILE2("SendRequestedPaths"); | PROFILE2("SendRequestedPaths"); | |||||||||
if (!m_LongPathRequests.m_ComputeDone || !m_ShortPathRequests.m_ComputeDone) | if (!m_LongPathRequests.m_ComputeDone || !m_ShortPathRequests.m_ComputeDone) | |||||||||
{ | { | |||||||||
// Also start computing on the main thread to finish faster. | // Also start computing on the main thread to finish faster. | |||||||||
m_ShortPathRequests.Compute(*this, m_VertexPathfinders.front()); | m_ShortPathRequests.Compute(*this, m_VertexPathfinders.front()); | |||||||||
StanUnsubmitted Done Inline Actions
Stan: | ||||||||||
Done Inline Actionsthanks phosit: thanks | ||||||||||
m_LongPathRequests.Compute(*this, *m_LongPathfinder); | m_LongPathRequests.Compute(*this, *m_LongPathfinder); | |||||||||
} | } | |||||||||
Done Inline ActionsWon't that be a big confusing with unique_ptr.get() ? Maybe GetResult() ? Not relevant to this patch directly though. Stan: Won't that be a big confusing with unique_ptr.get() ? Maybe GetResult() ? Not relevant to this… | ||||||||||
Done Inline ActionsI'd follow standart naming: there is std::unique_ptr::get and std::future::get phosit: I'd follow standart naming: there is `std::unique_ptr::get` and `std::future::get` | ||||||||||
// We're done, clear futures. | // We're done, get the exception from the futures. | |||||||||
// Use CancelOrWait instead of just Cancel to ensure determinism. | ||||||||||
for (Future<void>& future : m_Futures) | for (Future<void>& future : m_Futures) | |||||||||
future.CancelOrWait(); | future.Get(); | |||||||||
{ | { | |||||||||
PROFILE2("PostMessages"); | PROFILE2("PostMessages"); | |||||||||
for (PathResult& path : m_ShortPathRequests.m_Results) | for (PathResult& path : m_ShortPathRequests.m_Results) | |||||||||
{ | { | |||||||||
CMessagePathResult msg(path.ticket, path.path); | CMessagePathResult msg(path.ticket, path.path); | |||||||||
GetSimContext().GetComponentManager().PostMessage(path.notify, msg); | GetSimContext().GetComponentManager().PostMessage(path.notify, msg); | |||||||||
} | } | |||||||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator