MCPcopy Create free account
hub / github.com/comaps/comaps / RunTaskOnBackgroundThread

Method RunTaskOnBackgroundThread

libs/map/extrapolation/extrapolator.cpp:180–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void Extrapolator::RunTaskOnBackgroundThread(bool delayed)
181{
182 uint64_t locationUpdateCounter = 0;
183 {
184 lock_guard<mutex> guard(m_mutex);
185 locationUpdateCounter = m_locationUpdateCounter;
186 }
187
188 if (delayed)
189 {
190 auto constexpr period = std::chrono::milliseconds(kExtrapolationPeriodMs);
191 GetPlatform().RunDelayedTask(Platform::Thread::Background, period,
192 [this, locationUpdateCounter] { ExtrapolatedLocationUpdate(locationUpdateCounter); });
193 }
194 else
195 {
196 GetPlatform().RunTask(Platform::Thread::Background,
197 [this, locationUpdateCounter] { ExtrapolatedLocationUpdate(locationUpdateCounter); });
198 }
199}
200
201bool Extrapolator::DoesExtrapolationWork() const
202{

Callers

nothing calls this directly

Calls 2

RunDelayedTaskMethod · 0.80
RunTaskMethod · 0.80

Tested by

no test coverage detected