diff options
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 2a6aa7b..f3a88a1 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -419,12 +419,20 @@ void Camera2Client::disconnect() { ALOGV("Camera %d: Waiting for threads", mCameraId); - mStreamingProcessor->join(); - mFrameProcessor->join(); - mCaptureSequencer->join(); - mJpegProcessor->join(); - mZslProcessorThread->join(); - mCallbackProcessor->join(); + { + // Don't wait with lock held, in case the other threads need to + // complete callbacks that re-enter Camera2Client + mBinderSerializationLock.unlock(); + + mStreamingProcessor->join(); + mFrameProcessor->join(); + mCaptureSequencer->join(); + mJpegProcessor->join(); + mZslProcessorThread->join(); + mCallbackProcessor->join(); + + mBinderSerializationLock.lock(); + } ALOGV("Camera %d: Deleting streams", mCameraId); |