| 320 | } |
| 321 | |
| 322 | Status GraphMgr::Deregister(const string& handle) { |
| 323 | Item* item = nullptr; |
| 324 | // Removes one item from table_. |
| 325 | { |
| 326 | mutex_lock l(mu_); |
| 327 | auto iter = table_.find(handle); |
| 328 | if (iter == table_.end()) { |
| 329 | return errors::Aborted("Graph handle is not found: ", handle, |
| 330 | ". Possibly, this worker just restarted."); |
| 331 | } |
| 332 | item = iter->second; |
| 333 | table_.erase(iter); |
| 334 | } |
| 335 | item->Unref(); |
| 336 | return Status::OK(); |
| 337 | } |
| 338 | |
| 339 | Status GraphMgr::DeregisterAll() { |
| 340 | std::vector<Item*> items; |
no test coverage detected