Merge "Decrement size of pending write queue by correct amount" am: 79fc8d0212 am: b492ac69b5

Change-Id: I4c49229efbcfeeaaa2e4e7299dbac230f2ae9caf
This commit is contained in:
Automerger Merge Worker 2020-01-17 21:19:12 +00:00
commit 0cf13f7ded

View file

@ -486,15 +486,14 @@ void HalProxy::handlePendingWrites() {
} }
} }
lock.lock(); lock.lock();
mSizePendingWriteEventsQueue -= numToWrite;
if (pendingWriteEvents.size() > eventQueueSize) { if (pendingWriteEvents.size() > eventQueueSize) {
// TODO(b/143302327): Check if this erase operation is too inefficient. It will copy // TODO(b/143302327): Check if this erase operation is too inefficient. It will copy
// all the events ahead of it down to fill gap off array at front after the erase. // all the events ahead of it down to fill gap off array at front after the erase.
pendingWriteEvents.erase(pendingWriteEvents.begin(), pendingWriteEvents.erase(pendingWriteEvents.begin(),
pendingWriteEvents.begin() + eventQueueSize); pendingWriteEvents.begin() + eventQueueSize);
mSizePendingWriteEventsQueue -= eventQueueSize;
} else { } else {
mPendingWriteEventsQueue.pop(); mPendingWriteEventsQueue.pop();
mSizePendingWriteEventsQueue -= pendingWriteEvents.size();
} }
} }
} }