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

Method Cancel

libs/base/thread_pool_delayed.cpp:180–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180bool DelayedThreadPool::Cancel(TaskId id)
181{
182 std::lock_guard lk(m_mu);
183
184 if (m_shutdown || id == kNoId)
185 return false;
186
187 if (id <= kImmediateMaxId)
188 {
189 if (m_immediate.Erase(id))
190 {
191 m_cv.notify_one();
192 return true;
193 }
194 }
195 else if (m_delayed.RemoveKey(id))
196 {
197 m_cv.notify_one();
198 return true;
199 }
200
201 return false;
202}
203
204bool DelayedThreadPool::Shutdown(Exit e)
205{

Callers

nothing calls this directly

Calls 2

RemoveKeyMethod · 0.80
EraseMethod · 0.45

Tested by

no test coverage detected