Commit 59b47473 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Handle values different from pending_

Summary: Handle values different from pending_

Reviewed By: kevin-vigor

Differential Revision: D25968014

fbshipit-source-id: fd70dd6339d02a6325b237e6c9401d8962b17b51
parent 3fa09cb1
......@@ -199,10 +199,9 @@ Range<AsyncBase::Op**> AsyncBase::pollCompleted() {
DCHECK_EQ(rc, 8);
DCHECK_GT(numEvents, 0);
DCHECK_LE(numEvents, pending_);
// Don't reap more than numEvents, as we've just reset the counter to 0.
return doWait(WaitType::COMPLETE, numEvents, numEvents, completed_);
// Don't reap more than pending_, as we've just reset the counter to 0.
return doWait(WaitType::COMPLETE, 0, pending_.load(), completed_);
}
AsyncBaseQueue::AsyncBaseQueue(AsyncBase* asyncBase) : asyncBase_(asyncBase) {}
......
......@@ -156,7 +156,6 @@ void testReadsParallel(
auto completed =
test::async_base_test_lib_detail::TestUtil::readerWait(aioReader.get());
size_t nrRead = completed.size();
EXPECT_NE(nrRead, 0);
remaining -= nrRead;
for (size_t i = 0; i < nrRead; i++) {
......@@ -217,7 +216,6 @@ void testReadsQueued(
auto completed =
test::async_base_test_lib_detail::TestUtil::readerWait(aioReader.get());
size_t nrRead = completed.size();
EXPECT_NE(nrRead, 0);
remaining -= nrRead;
for (size_t i = 0; i < nrRead; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment