summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Mohan M2017-09-26 05:06:16 -0500
committerPawin Vongmasa2017-09-29 06:39:48 -0500
commit028540b3a16421a5dcf5a0277820464423e0d675 (patch)
tree87fadfa09b3686095e1a7662c8ea74402ed70b28 /media/omx/1.0
parentf213eca9170081ca128288816f404beeb53a41f0 (diff)
downloadplatform-hardware-interfaces-028540b3a16421a5dcf5a0277820464423e0d675.tar.gz
platform-hardware-interfaces-028540b3a16421a5dcf5a0277820464423e0d675.tar.xz
platform-hardware-interfaces-028540b3a16421a5dcf5a0277820464423e0d675.zip
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
Diffstat (limited to 'media/omx/1.0')
-rw-r--r--media/omx/1.0/vts/functional/common/media_hidl_test_common.h2
1 files changed, 1 insertions, 1 deletions
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 e23d781b..de043b2c 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 @@ struct CodecObserver : public IOmxObserver {
126 android::Vector<BufferInfo>* iBuffers = nullptr, 126 android::Vector<BufferInfo>* iBuffers = nullptr,
127 android::Vector<BufferInfo>* oBuffers = nullptr) { 127 android::Vector<BufferInfo>* oBuffers = nullptr) {
128 int64_t finishBy = android::ALooper::GetNowUs() + timeoutUs; 128 int64_t finishBy = android::ALooper::GetNowUs() + timeoutUs;
129 android::Mutex::Autolock autoLock(msgLock);
130 for (;;) { 129 for (;;) {
130 android::Mutex::Autolock autoLock(msgLock);
131 android::List<Message>::iterator it = msgQueue.begin(); 131 android::List<Message>::iterator it = msgQueue.begin();
132 while (it != msgQueue.end()) { 132 while (it != msgQueue.end()) {
133 if (it->type == 133 if (it->type ==