summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Emilian Peev <epeev@google.com> 2023-02-23 16:48:53 -0800
committer Emilian Peev <epeev@google.com> 2023-03-13 15:04:16 -0700
commit6231472fb15c9f35249ec4e621a2b2115a6a2141 (patch)
tree3cedc8449641caf76c30e46f4e08d49f258e1f33 /libs/androidfw/FileStream.cpp
parentae41acbe90c5a33c24084db4f93e3072d95df0db (diff)
Camera: Avoid holding locks during extension initialization
Holding the interface lock while initializing the extension is not really necessary and can potentially result in a deadlock in case of failure where callbacks try to close the camera capture session in the handler thread, and another thread tries to close the camera device acquiring the interface lock there: Thread1: CameraDeviceImpl.close() acquire the device interface lock release advanced extension try to acquire the extension characteristics lock Thread2: InitializationSessionHandler.onFailure() while holding the extension characteristics lock mCaptureSession.close() try to acquire the device interface lock Additionally re-use the device interface lock for the extension session synchronization. There is no real need to use a separate lock which complicates the lock acquire order. Bug: 270276341 Test: atest -c -d cts/tests/camera/src/android/hardware/camera2/cts/CameraExtensionSessionTest.java Change-Id: Ice808c8d5538e3adb3220d7ea51dea4b14cc2f44
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions