diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-12-05 11:00:37 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2014-03-05 14:31:30 -0800 |
commit | 6706009fa8294c8cdab1cdab4585f00d42df483e (patch) | |
tree | 55fcdca48c005adaa2d25cc3e87715345e31e5ce | |
parent | 81d754306ecd4a587459015da5168270c2a5c167 (diff) | |
download | frameworks_av-6706009fa8294c8cdab1cdab4585f00d42df483e.zip frameworks_av-6706009fa8294c8cdab1cdab4585f00d42df483e.tar.gz frameworks_av-6706009fa8294c8cdab1cdab4585f00d42df483e.tar.bz2 |
DO NOT MERGE: camera2: Fix race with stream deletion during disconnect.
Bug: 11856804
- Shutdown order in Camera2Client allows a stream to be
deleted before the corresponding processing thread has
quit. This can result in updates being called on the
processor thread without a valid stream.
Change-Id: Ie4e649771f4321498659211f2a37ed89a6d956c4
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 0b6ca5c..abcbd06 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -406,12 +406,6 @@ void Camera2Client::disconnect() { l.mParameters.state = Parameters::DISCONNECTED; } - mStreamingProcessor->deletePreviewStream(); - mStreamingProcessor->deleteRecordingStream(); - mJpegProcessor->deleteStream(); - mCallbackProcessor->deleteStream(); - mZslProcessor->deleteStream(); - mStreamingProcessor->requestExit(); mFrameProcessor->requestExit(); mCaptureSequencer->requestExit(); @@ -428,6 +422,14 @@ void Camera2Client::disconnect() { mZslProcessorThread->join(); mCallbackProcessor->join(); + ALOGV("Camera %d: Deleting streams", mCameraId); + + mStreamingProcessor->deletePreviewStream(); + mStreamingProcessor->deleteRecordingStream(); + mJpegProcessor->deleteStream(); + mCallbackProcessor->deleteStream(); + mZslProcessor->deleteStream(); + ALOGV("Camera %d: Disconnecting device", mCameraId); mDevice->disconnect(); |