Camera2: Fix a deadlock when closing the camera

Change-Id: I8b6be364ca90b0eed62ae03c1548680c0b2f0e64
This commit is contained in:
Igor Murashkin
2012-12-07 12:32:00 -08:00
parent 328bdf979a
commit 0825f8b65b

View File

@@ -165,6 +165,7 @@ status_t EmulatedFakeCamera2::connectCamera(hw_device_t** device) {
}
status_t EmulatedFakeCamera2::closeCamera() {
{
Mutex::Autolock l(mMutex);
status_t res;
@@ -180,7 +181,10 @@ status_t EmulatedFakeCamera2::closeCamera() {
mReadoutThread->requestExit();
mControlThread->requestExit();
mJpegCompressor->cancel();
}
// give up the lock since we will now block and the threads
// can call back into this object
mConfigureThread->join();
mReadoutThread->join();
mControlThread->join();