Merge "Camera2: Fix a deadlock when closing the camera: DO NOT MERGE" into jb-mr1-aah-dev

This commit is contained in:
Igor Murashkin
2013-01-10 13:34:20 -08:00
committed by Android (Google) Code Review

View File

@@ -166,6 +166,7 @@ status_t EmulatedFakeCamera2::connectCamera(hw_device_t** device) {
}
status_t EmulatedFakeCamera2::closeCamera() {
{
Mutex::Autolock l(mMutex);
status_t res;
@@ -181,7 +182,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();