Loading services/camera/libcameraservice/device3/Camera3Device.cpp +70 −71 Original line number Diff line number Diff line Loading @@ -339,12 +339,12 @@ status_t Camera3Device::disconnect() { status_t Camera3Device::disconnectImpl() { ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); ALOGI("%s: E", __FUNCTION__); status_t res = OK; std::vector<wp<Camera3StreamInterface>> streams; { Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); { Mutex::Autolock l(mLock); Loading Loading @@ -386,16 +386,19 @@ status_t Camera3Device::disconnectImpl() { streams.push_back(mInputStream); } } // Joining done without holding mLock, otherwise deadlocks may ensue // as the threads try to access parent state } // Joining done without holding mLock and mInterfaceLock, otherwise deadlocks may ensue // as the threads try to access parent state (b/143513518) if (mRequestThread != NULL && mStatus != STATUS_ERROR) { // HAL may be in a bad state, so waiting for request thread // (which may be stuck in the HAL processCaptureRequest call) // could be dangerous. // give up mInterfaceLock here and then lock it again. Could this lead // to other deadlocks mRequestThread->join(); } { Mutex::Autolock il(mInterfaceLock); if (mStatusTracker != NULL) { mStatusTracker->join(); } Loading Loading @@ -432,7 +435,7 @@ status_t Camera3Device::disconnectImpl() { __FUNCTION__, stream->getId(), stream->getStrongCount() - 1); } } } ALOGI("%s: X", __FUNCTION__); return res; } Loading Loading @@ -2165,9 +2168,7 @@ void Camera3Device::internalUpdateStatusLocked(Status status) { } void Camera3Device::pauseStateNotify(bool enable) { // We must not hold mInterfaceLock here since this function is called from // RequestThread::threadLoop and holding mInterfaceLock could lead to // deadlocks (http://b/143513518) Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); mPauseStateNotify = enable; Loading Loading @@ -2744,9 +2745,7 @@ bool Camera3Device::reconfigureCamera(const CameraMetadata& sessionParams) { ATRACE_CALL(); bool ret = false; // We must not hold mInterfaceLock here since this function is called from // RequestThread::threadLoop and holding mInterfaceLock could lead to // deadlocks (http://b/143513518) Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Loading services/camera/libcameraservice/device3/Camera3Device.h +0 −1 Original line number Diff line number Diff line Loading @@ -244,7 +244,6 @@ class Camera3Device : // A lock to enforce serialization on the input/configure side // of the public interface. // Only locked by public methods inherited from CameraDeviceBase. // Not locked by methods guarded by mOutputLock, since they may act // concurrently to the input/configure side of the interface. // Must be locked before mLock if both will be locked by a method Loading Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +70 −71 Original line number Diff line number Diff line Loading @@ -339,12 +339,12 @@ status_t Camera3Device::disconnect() { status_t Camera3Device::disconnectImpl() { ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); ALOGI("%s: E", __FUNCTION__); status_t res = OK; std::vector<wp<Camera3StreamInterface>> streams; { Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); { Mutex::Autolock l(mLock); Loading Loading @@ -386,16 +386,19 @@ status_t Camera3Device::disconnectImpl() { streams.push_back(mInputStream); } } // Joining done without holding mLock, otherwise deadlocks may ensue // as the threads try to access parent state } // Joining done without holding mLock and mInterfaceLock, otherwise deadlocks may ensue // as the threads try to access parent state (b/143513518) if (mRequestThread != NULL && mStatus != STATUS_ERROR) { // HAL may be in a bad state, so waiting for request thread // (which may be stuck in the HAL processCaptureRequest call) // could be dangerous. // give up mInterfaceLock here and then lock it again. Could this lead // to other deadlocks mRequestThread->join(); } { Mutex::Autolock il(mInterfaceLock); if (mStatusTracker != NULL) { mStatusTracker->join(); } Loading Loading @@ -432,7 +435,7 @@ status_t Camera3Device::disconnectImpl() { __FUNCTION__, stream->getId(), stream->getStrongCount() - 1); } } } ALOGI("%s: X", __FUNCTION__); return res; } Loading Loading @@ -2165,9 +2168,7 @@ void Camera3Device::internalUpdateStatusLocked(Status status) { } void Camera3Device::pauseStateNotify(bool enable) { // We must not hold mInterfaceLock here since this function is called from // RequestThread::threadLoop and holding mInterfaceLock could lead to // deadlocks (http://b/143513518) Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); mPauseStateNotify = enable; Loading Loading @@ -2744,9 +2745,7 @@ bool Camera3Device::reconfigureCamera(const CameraMetadata& sessionParams) { ATRACE_CALL(); bool ret = false; // We must not hold mInterfaceLock here since this function is called from // RequestThread::threadLoop and holding mInterfaceLock could lead to // deadlocks (http://b/143513518) Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Loading
services/camera/libcameraservice/device3/Camera3Device.h +0 −1 Original line number Diff line number Diff line Loading @@ -244,7 +244,6 @@ class Camera3Device : // A lock to enforce serialization on the input/configure side // of the public interface. // Only locked by public methods inherited from CameraDeviceBase. // Not locked by methods guarded by mOutputLock, since they may act // concurrently to the input/configure side of the interface. // Must be locked before mLock if both will be locked by a method Loading