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

Method waitForCompleteAll

bolt/common/file/File.cpp:679–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677}
678
679bool AsyncLocalWriteFile::waitForCompleteAll() {
680 io_uring_cqe* cqe;
681 auto pending = pending_.wlock();
682 while (*pending > 0) {
683 int ret = io_uring_wait_cqe(ring_.get(), &cqe);
684 if (ret < 0) {
685 LOG(ERROR) << "Failed to wait for CQE with errorno " << -ret << " : "
686 << std::strerror(-ret);
687 return false;
688 }
689 if (cqe->res < 0) {
690 LOG(ERROR) << "Failed to get result with errorno " << -(cqe->res) << " : "
691 << std::strerror(-cqe->res);
692 return false;
693 } else {
694 (*pending)--;
695 io_uring_cqe_seen(ring_.get(), cqe);
696 }
697 }
698 return true;
699}
700
701void AsyncLocalWriteFile::close() {
702 if (!closed_) {

Callers 2

clearMethod · 0.45
writeDataAsyncFunction · 0.45

Calls 1

getMethod · 0.45

Tested by 1

writeDataAsyncFunction · 0.36