summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilian Peev <epeev@mm-sol.com>2012-02-10 15:00:34 +0200
committerDaniel Levin <dendy@ti.com>2012-07-25 08:55:43 -0500
commit994fa9105056ee72d4897fdc248edb7be9745d19 (patch)
tree5740baadf12ee75ecb4bb59330547f0d3d78362c
parentff4e31d0dec32d7219024df9cb0de99999487747 (diff)
downloadhardware_ti_omap4-994fa9105056ee72d4897fdc248edb7be9745d19.zip
hardware_ti_omap4-994fa9105056ee72d4897fdc248edb7be9745d19.tar.gz
hardware_ti_omap4-994fa9105056ee72d4897fdc248edb7be9745d19.tar.bz2
CameraHAL: Lock mutex on handleFrameReturn
- Prevents an issue when concurrent access to the buffer map may crash the CameraHAL. Change-Id: I74b8abde0e2a56fa73da6655c3b3529b55974a32 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
-rw-r--r--camera/ANativeWindowDisplayAdapter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/camera/ANativeWindowDisplayAdapter.cpp b/camera/ANativeWindowDisplayAdapter.cpp
index 49204d8..747168e 100644
--- a/camera/ANativeWindowDisplayAdapter.cpp
+++ b/camera/ANativeWindowDisplayAdapter.cpp
@@ -1220,7 +1220,10 @@ bool ANativeWindowDisplayAdapter::handleFrameReturn()
usleep(15000);
}
- mFramesWithCameraAdapterMap.add((int) mGrallocHandleMap[i], i);
+ {
+ Mutex::Autolock lock(mLock);
+ mFramesWithCameraAdapterMap.add((int) mGrallocHandleMap[i], i);
+ }
CAMHAL_LOGVB("handleFrameReturn: found graphic buffer %d of %d", i, mBufferCount-1);
mFrameProvider->returnFrame( (void*)mGrallocHandleMap[i], CameraFrame::PREVIEW_FRAME_SYNC);