summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/device3/Camera3Device.cpp
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-03-23 18:44:49 -0700
committerZhijun He <zhijunhe@google.com>2014-03-23 18:44:49 -0700
commit69a374897392c8bd70f441b7284f6f578c651ec9 (patch)
treede179831b224e28e6693430e80e3299f35c874bf /services/camera/libcameraservice/device3/Camera3Device.cpp
parent2f5d0b32a8c5fcb03e4b0d55c53ff540052b5374 (diff)
downloadframeworks_av-69a374897392c8bd70f441b7284f6f578c651ec9.zip
frameworks_av-69a374897392c8bd70f441b7284f6f578c651ec9.tar.gz
frameworks_av-69a374897392c8bd70f441b7284f6f578c651ec9.tar.bz2
Camera3: Fix flush call deadlock
Flush shouldn't call waitUntilDrained directly, as they are all API calls with mLock and mInterfaceLock held. Move the waitUntilDrained implementation into waitUntilDrainedLocked to solve this issue. Change-Id: Id7d931091d5c11e12204790841097433515446db
Diffstat (limited to 'services/camera/libcameraservice/device3/Camera3Device.cpp')
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index e5ac037..efc1bc7 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -997,6 +997,10 @@ status_t Camera3Device::waitUntilDrained() {
Mutex::Autolock il(mInterfaceLock);
Mutex::Autolock l(mLock);
+ return waitUntilDrainedLocked();
+}
+
+status_t Camera3Device::waitUntilDrainedLocked() {
switch (mStatus) {
case STATUS_UNINITIALIZED:
case STATUS_UNCONFIGURED:
@@ -1207,7 +1211,7 @@ status_t Camera3Device::flush() {
if (mHal3Device->common.version >= CAMERA_DEVICE_API_VERSION_3_1) {
res = mHal3Device->ops->flush(mHal3Device);
} else {
- res = waitUntilDrained();
+ res = waitUntilDrainedLocked();
}
return res;