Merge "Camera2: Fix a deadlock when closing the camera"
This commit is contained in:
committed by
Android (Google) Code Review
commit
52f7c8d4c6
@@ -165,6 +165,7 @@ status_t EmulatedFakeCamera2::connectCamera(hw_device_t** device) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t EmulatedFakeCamera2::closeCamera() {
|
status_t EmulatedFakeCamera2::closeCamera() {
|
||||||
|
{
|
||||||
Mutex::Autolock l(mMutex);
|
Mutex::Autolock l(mMutex);
|
||||||
|
|
||||||
status_t res;
|
status_t res;
|
||||||
@@ -180,7 +181,10 @@ status_t EmulatedFakeCamera2::closeCamera() {
|
|||||||
mReadoutThread->requestExit();
|
mReadoutThread->requestExit();
|
||||||
mControlThread->requestExit();
|
mControlThread->requestExit();
|
||||||
mJpegCompressor->cancel();
|
mJpegCompressor->cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
// give up the lock since we will now block and the threads
|
||||||
|
// can call back into this object
|
||||||
mConfigureThread->join();
|
mConfigureThread->join();
|
||||||
mReadoutThread->join();
|
mReadoutThread->join();
|
||||||
mControlThread->join();
|
mControlThread->join();
|
||||||
|
|||||||
Reference in New Issue
Block a user