MCPcopy Create free account
hub / github.com/bytedance/bolt / waitForComplete

Method waitForComplete

bolt/common/file/File.cpp:488–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488bool AsyncLocalReadFile::waitForComplete() {
489 auto pending = pending_.wlock();
490 if (*pending == 0)
491 return true;
492 io_uring_cqe* cqe;
493 while (*pending > 0) {
494 int ret = io_uring_wait_cqe(ring_.get(), &cqe);
495 if (ret < 0) {
496 LOG(ERROR) << "Failed to wait for CQE with errorno " << -ret << " : "
497 << std::strerror(-ret);
498 return false;
499 }
500 if (cqe->res < 0) {
501 LOG(ERROR) << "Failed to get result with errorno " << -(cqe->res) << " : "
502 << std::strerror(-cqe->res);
503 return false;
504 } else {
505 (*pending)--;
506 io_uring_cqe_seen(ring_.get(), cqe);
507 }
508 }
509 return true;
510}
511
512uint64_t AsyncLocalReadFile::size() const {
513 return size_;

Callers 4

nextMethod · 0.45
addMethod · 0.45
readDataAsyncFunction · 0.45

Calls 3

getMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45

Tested by 2

readDataAsyncFunction · 0.36