summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-08-27 23:42:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-27 23:42:01 +0000
commit13d98f419c614c5d389b06232ff99f7fe00dabf7 (patch)
tree672d3b4e843457d6b5e33eda444dece6a6e1d61b /services
parent277090f1983a6378958c24028d4f58c33c0659b2 (diff)
parent5487fd54f344c422be089217e62098545704bb03 (diff)
downloadframeworks_av-13d98f419c614c5d389b06232ff99f7fe00dabf7.zip
frameworks_av-13d98f419c614c5d389b06232ff99f7fe00dabf7.tar.gz
frameworks_av-13d98f419c614c5d389b06232ff99f7fe00dabf7.tar.bz2
Merge "Camera API1: Fix ZSLProcessor3 deadlock" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
index b388079..3999047 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
@@ -554,13 +554,15 @@ void ZslProcessor3::onBufferAcquired(const BufferInfo& /*bufferInfo*/) {
}
void ZslProcessor3::onBufferReleased(const BufferInfo& bufferInfo) {
- Mutex::Autolock l(mInputMutex);
// ignore output buffers
if (bufferInfo.mOutput) {
return;
}
+ // Lock mutex only once we know this is an input buffer returned to avoid
+ // potential deadlock
+ Mutex::Autolock l(mInputMutex);
// TODO: Verify that the buffer is in our queue by looking at timestamp
// theoretically unnecessary unless we change the following assumptions:
// -- only 1 buffer reprocessed at a time (which is the case now)