| 144 | } |
| 145 | |
| 146 | bool KeyCache::Unregister(id_t id) |
| 147 | { |
| 148 | lock_guard<mutex> lock(m_mutex); |
| 149 | |
| 150 | auto it = m_entries.find(id); |
| 151 | |
| 152 | assert(it != m_entries.end()); |
| 153 | |
| 154 | if (it == m_entries.end()) |
| 155 | return false; |
| 156 | |
| 157 | if (it->second.valid) |
| 158 | m_valid_count--; |
| 159 | |
| 160 | m_entries.erase(it); |
| 161 | |
| 162 | return true; |
| 163 | } |
| 164 | |
| 165 | void KeyCache::Enable() |
| 166 | { |
no test coverage detected