summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-08-29 17:43:01 -0700
committerIgor Murashkin <iam@google.com>2013-08-29 17:55:08 -0700
commit4fb55c15da1a563ab925914a0f493a3dc80495a3 (patch)
treebd33050f671a5cdaa6fdb121b115fb84f7e5d8e8 /services/camera/libcameraservice
parented474f370947856e72795c641672fcad90442fcf (diff)
downloadframeworks_av-4fb55c15da1a563ab925914a0f493a3dc80495a3.zip
frameworks_av-4fb55c15da1a563ab925914a0f493a3dc80495a3.tar.gz
frameworks_av-4fb55c15da1a563ab925914a0f493a3dc80495a3.tar.bz2
camera: Fix deadlock when sending callbacks during disconnect
Bug: 10552448 Change-Id: Ie93ba744ae6705aa657f980ae8e08ec624feeb39
Diffstat (limited to 'services/camera/libcameraservice')
-rw-r--r--services/camera/libcameraservice/api2/CameraDeviceClient.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
index 289ba06..f147c06 100644
--- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
+++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
@@ -500,14 +500,12 @@ void CameraDeviceClient::onFrameAvailable(int32_t frameId,
ATRACE_CALL();
ALOGV("%s", __FUNCTION__);
- Mutex::Autolock icl(mBinderSerializationLock);
- SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);
-
- if (mRemoteCallback != NULL) {
+ // Thread-safe. No lock necessary.
+ sp<ICameraDeviceCallbacks> remoteCb = mRemoteCallback;
+ if (remoteCb != NULL) {
ALOGV("%s: frame = %p ", __FUNCTION__, &frame);
- mRemoteCallback->onResultReceived(frameId, frame);
+ remoteCb->onResultReceived(frameId, frame);
}
-
}
// TODO: move to Camera2ClientBase