Revert "Fix lifecycle issue in CommonPool"
This reverts commit 5ff61f32a78dca0c722c8ac2685874a26190ceed.
Reason for revert: causes global presubmit to be very flaky, see b/130081457
Fixes: b/130081457
Change-Id: I93aa5d6686cd6b5bf831766c9e47c291749526a9
diff --git a/libs/hwui/thread/CommonPool.h b/libs/hwui/thread/CommonPool.h
index 5162825..aef2990 100644
--- a/libs/hwui/thread/CommonPool.h
+++ b/libs/hwui/thread/CommonPool.h
@@ -57,13 +57,11 @@
mHead = newHead;
}
- constexpr T pop() {
+ constexpr T&& pop() {
LOG_ALWAYS_FATAL_IF(mTail == mHead, "empty");
int index = mTail;
mTail = (mTail + 1) % SIZE;
- T ret = std::move(mBuffer[index]);
- mBuffer[index] = nullptr;
- return ret;
+ return std::move(mBuffer[index]);
}
private: