omxvts: misplaced lock can cause race condition
upon unsuccessful return during timed wait, relock the mutex before
accessing message list.
Bug: 63796949
Change-Id: I84a43e148a6415e629cb39a6b9dfe27259f8f2fd
diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
index e23d781..de043b2 100644
--- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
+++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
@@ -126,8 +126,8 @@
android::Vector<BufferInfo>* iBuffers = nullptr,
android::Vector<BufferInfo>* oBuffers = nullptr) {
int64_t finishBy = android::ALooper::GetNowUs() + timeoutUs;
- android::Mutex::Autolock autoLock(msgLock);
for (;;) {
+ android::Mutex::Autolock autoLock(msgLock);
android::List<Message>::iterator it = msgQueue.begin();
while (it != msgQueue.end()) {
if (it->type ==