| 250 | } |
| 251 | |
| 252 | Future<Void> AsyncFileCached::flush() { |
| 253 | ++countFileCacheWrites; |
| 254 | ++countCacheWrites; |
| 255 | |
| 256 | std::vector<Future<Void>> unflushed; |
| 257 | |
| 258 | int debug_count = flushable.size(); |
| 259 | for (int i = 0; i < flushable.size();) { |
| 260 | auto p = flushable[i]; |
| 261 | auto f = p->flush(); |
| 262 | if (!f.isReady() || f.isError()) |
| 263 | unflushed.push_back(f); |
| 264 | ASSERT((i < flushable.size() && flushable[i] == p) != f.isReady()); |
| 265 | if (!f.isReady()) |
| 266 | i++; |
| 267 | } |
| 268 | ASSERT(flushable.size() <= debug_count); |
| 269 | |
| 270 | return waitForAll(unflushed); |
| 271 | } |
| 272 | |
| 273 | Future<Void> AsyncFileCached::quiesce() { |
| 274 | std::vector<Future<Void>> unquiescent; |
no test coverage detected