MCPcopy Create free account
hub / github.com/baidu/tera / ClearDelayTask

Method ClearDelayTask

src/sdk/table_impl.cc:2253–2267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2251}
2252
2253void TableImpl::ClearDelayTask() {
2254 MutexLock lock(&delay_task_id_mutex_);
2255 std::set<int64_t>::iterator it = delay_task_ids_.begin();
2256 while (it != delay_task_ids_.end()) {
2257 int64_t task_id = *it;
2258 // may deadlock, MUST unlock
2259 delay_task_id_mutex_.Unlock();
2260 bool cancelled = thread_pool_->CancelTask(*it);
2261 delay_task_id_mutex_.Lock();
2262 if (cancelled) {
2263 delay_task_ids_.erase(task_id);
2264 }
2265 it = delay_task_ids_.begin();
2266 }
2267}
2268
2269void TableImpl::BreakRequest(int64_t task_id) {
2270 SdkTask* task = task_pool_.PopTask(task_id);

Callers

nothing calls this directly

Calls 3

CancelTaskMethod · 0.80
UnlockMethod · 0.45
LockMethod · 0.45

Tested by

no test coverage detected