| 183 | } |
| 184 | |
| 185 | void FileHandleCache::EvictHandlesLoop() { |
| 186 | while (true) { |
| 187 | if (unused_handle_timeout_secs_) { |
| 188 | for (FileHandleCachePartition& p : cache_partitions_) { |
| 189 | uint64_t now = MonotonicSeconds(); |
| 190 | uint64_t oldest_allowed_timestamp = |
| 191 | now > unused_handle_timeout_secs_ ? now - unused_handle_timeout_secs_ : 0; |
| 192 | p.cache.EvictOlderThan(oldest_allowed_timestamp); |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | // This Get() will time out until shutdown, when the promise is set. |
| 197 | bool timed_out; |
| 198 | shut_down_promise_.Get(EVICT_HANDLES_PERIOD_MS, &timed_out); |
| 199 | if (!timed_out) break; |
| 200 | } |
| 201 | // The promise must be set to true. |
| 202 | DCHECK(shut_down_promise_.IsSet()); |
| 203 | DCHECK(shut_down_promise_.Get()); |
| 204 | } |
| 205 | |
| 206 | } |
| 207 | } |
nothing calls this directly
no test coverage detected