| 127 | } |
| 128 | |
| 129 | void GpsTrack::ScheduleTask() |
| 130 | { |
| 131 | lock_guard<mutex> lg(m_threadGuard); |
| 132 | |
| 133 | if (m_thread.get_id() == std::thread::id()) |
| 134 | { |
| 135 | m_thread = threads::SimpleThread([this]() |
| 136 | { |
| 137 | unique_lock<mutex> ul(m_threadGuard); |
| 138 | while (true) |
| 139 | { |
| 140 | m_cv.wait(ul, [this]() -> bool { return m_threadExit || m_threadWakeup; }); |
| 141 | if (m_threadExit) |
| 142 | break; |
| 143 | m_threadWakeup = false; |
| 144 | ProcessPoints(); |
| 145 | } |
| 146 | |
| 147 | m_storage.reset(); |
| 148 | }); |
| 149 | } |
| 150 | |
| 151 | m_threadWakeup = true; |
| 152 | m_cv.notify_one(); |
| 153 | } |
| 154 | |
| 155 | void GpsTrack::InitStorageIfNeed() |
| 156 | { |
nothing calls this directly
no test coverage detected