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

Method ScheduleTask

libs/map/gps_track.cpp:129–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void 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
155void GpsTrack::InitStorageIfNeed()
156{

Callers

nothing calls this directly

Calls 4

SimpleThreadClass · 0.85
waitMethod · 0.80
get_idMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected