summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2011-08-10 18:39:31 -0500
committerIliyan Malchev <malchev@google.com>2011-08-11 11:12:10 -0700
commitce8e32eddf46a966b6f637c30ad0c464631c1d86 (patch)
tree69e3dd15e4bda0082294daf315577b64d28a40b2
parent226b496d5cce18e5898383bf479fdd42f2b5abdb (diff)
downloadhardware_ti_omap4xxx-ce8e32eddf46a966b6f637c30ad0c464631c1d86.zip
hardware_ti_omap4xxx-ce8e32eddf46a966b6f637c30ad0c464631c1d86.tar.gz
hardware_ti_omap4xxx-ce8e32eddf46a966b6f637c30ad0c464631c1d86.tar.bz2
CameraHal: Prevent issue when free/aqcuire handle
There could be a potential issue if a CameraHal instance tries to acquire an OMX Camera handle while another instance is freeing it. Change-Id: I33e4c679efc11561ceca3aee217952939bfad6b7
-rw-r--r--camera/OMXCameraAdapter/OMXCameraAdapter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index 9c98d3e..676d04a 100644
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -3059,6 +3059,8 @@ OMXCameraAdapter::~OMXCameraAdapter()
{
LOG_FUNCTION_NAME;
+ Mutex::Autolock lock(gAdapterLock);
+
//Return to OMX Loaded state
switchToLoaded();