| 178 | } |
| 179 | |
| 180 | void 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 | |
| 201 | bool Extrapolator::DoesExtrapolationWork() const |
| 202 | { |
nothing calls this directly
no test coverage detected