| 82 | } |
| 83 | |
| 84 | void OpSegment::RemoveHold(const string& session_handle) { |
| 85 | Item* item = nullptr; |
| 86 | { |
| 87 | mutex_lock l(mu_); |
| 88 | auto siter = sessions_.find(session_handle); |
| 89 | if (siter == sessions_.end()) { |
| 90 | VLOG(1) << "Session " << session_handle << " is not found."; |
| 91 | return; |
| 92 | } |
| 93 | item = siter->second; |
| 94 | if (--(item->num_holds) > 0) { |
| 95 | return; |
| 96 | } else { |
| 97 | sessions_.erase(siter); |
| 98 | } |
| 99 | } |
| 100 | delete item; |
| 101 | } |
| 102 | |
| 103 | bool OpSegment::ShouldOwnKernel(FunctionLibraryRuntime* lib, |
| 104 | const string& node_op) { |