Merge "Camera2: Fix a deadlock when closing the camera"

This commit is contained in:
Igor Murashkin
2012-12-12 12:47:47 -08:00
committed by Android (Google) Code Review

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();