diff options
author | Zach Pfeffer <zach.pfeffer@linaro.org> | 2012-01-31 17:18:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@betelgeuse.canonical.com> | 2012-01-31 17:18:07 +0000 |
commit | 2b6c0f3e5764f73e73f2e2e377617619e6ff6fc2 (patch) | |
tree | a293d7de8cae46d55f8e0ab8c3cc531d4b3907a9 | |
parent | f2c5eb2a89201f31497a56dc54cbb05a09091ce2 (diff) | |
parent | 960ea274d0355bb144558e1176a4597f00bbbde4 (diff) | |
download | base-2b6c0f3e5764f73e73f2e2e377617619e6ff6fc2.tar.gz |
Merge "camera: merged http://review.omapzoom.org/#change,14346 to fix race condition while image capture" into linaro_android_4.0.3
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index bb0e66463835..c331e78ae9b1 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -916,6 +916,12 @@ bool CameraService::Client::lockIfMessageWanted(int32_t msgType) { LOG1("lockIfMessageWanted(%d): enter sleep", msgType); } usleep(CHECK_MESSAGE_INTERVAL * 1000); + // Return true after 100ms. We don't want to enter in an infinite loop. + if (sleepCount == 10) { + LOGE("lockIfMessageWanted(%d): timed out in %d ms", + msgType, sleepCount * CHECK_MESSAGE_INTERVAL); + return true; + } } LOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType); return false; |