MCPcopy Create free account
hub / github.com/apache/arrow / LoopReading

Method LoopReading

cpp/src/arrow/io/file_benchmark.cc:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 }
92
93 void LoopReading() {
94 const HANDLE handles[] = {file_handle_, event_};
95 while (true) {
96 DWORD ret = WaitForMultipleObjects(2, handles, /* bWaitAll=*/FALSE, INFINITE);
97 ARROW_CHECK_NE(ret, WAIT_FAILED);
98 if (ret == WAIT_OBJECT_0 + 1) {
99 // Got stop request
100 break;
101 } else if (ret == WAIT_OBJECT_0) {
102 // File ready for reading
103 total_bytes_ += *internal::FileRead(fd_, buffer_, buffer_size_);
104 } else {
105 ARROW_LOG(FATAL) << "Unexpected WaitForMultipleObjects return value " << ret;
106 }
107 }
108 }
109
110 int fd_;
111 HANDLE file_handle_, event_;

Callers 1

StartReaderMethod · 0.80

Calls 3

FileReadFunction · 0.85
fdMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected