diff options
author | Igor Murashkin <iam@google.com> | 2013-08-30 18:32:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-30 18:32:14 +0000 |
commit | d656a4be3c3b6bc249b06599c2b02c2863d2c47f (patch) | |
tree | fb7417309c1b4a1fdbaec7b9705ac1eb114c02a3 /services | |
parent | 9404fa6ac9f76f8f8d898e35f4fa03906a553e0a (diff) | |
parent | 4fb55c15da1a563ab925914a0f493a3dc80495a3 (diff) | |
download | frameworks_av-d656a4be3c3b6bc249b06599c2b02c2863d2c47f.zip frameworks_av-d656a4be3c3b6bc249b06599c2b02c2863d2c47f.tar.gz frameworks_av-d656a4be3c3b6bc249b06599c2b02c2863d2c47f.tar.bz2 |
Merge "camera: Fix deadlock when sending callbacks during disconnect" into klp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/api2/CameraDeviceClient.cpp | 10 |
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 |