Skip to content

Commit fa5d460

Browse files
committed
cleanup.
1 parent 23a89b0 commit fa5d460

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/data/sparse_page_source.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ class SparsePageSourceImpl : public BatchIteratorImpl<S> {
132132
}
133133
auto const *self = this; // make sure it's const
134134
CHECK_LT(fetch_it, cache_info_->offset.size());
135-
dmlc::OMPException exec;
136-
ring_->at(fetch_it) = std::async(std::launch::async, [&exec, fetch_it, self]() {
135+
ring_->at(fetch_it) = std::async(std::launch::async, [fetch_it, self]() {
137136
auto page = std::make_shared<S>();
138137

139138
common::Timer timer;
@@ -156,12 +155,11 @@ class SparsePageSourceImpl : public BatchIteratorImpl<S> {
156155
LOG(INFO) << "Read a page in " << timer.ElapsedSeconds() << " seconds.";
157156

158157
// cleanup
159-
CHECK_NE(close(fd), -1) << "Faled to close: " << n << ". " << strerror(errno);
160158
CHECK_NE(munmap(ptr, length), -1) << "Faled to munmap: " << n << ". " << strerror(errno);
159+
CHECK_NE(close(fd), -1) << "Faled to close: " << n << ". " << strerror(errno);
161160

162161
return page;
163162
});
164-
exec.Rethrow();
165163
}
166164
CHECK_EQ(std::count_if(ring_->cbegin(), ring_->cend(), [](auto const& f) { return f.valid(); }),
167165
n_prefetch_batches)

0 commit comments

Comments
 (0)