summaryrefslogtreecommitdiffstats
path: root/camera/BufferSourceAdapter.cpp
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-05-30 16:46:02 -0500
committerDaniel Levin <dendy@ti.com>2012-11-26 18:22:45 +0200
commitb69e4dc58ad88dea2908a6583b900661c799e38f (patch)
tree031876722df969ff62e52909eacbaddb421bd570 /camera/BufferSourceAdapter.cpp
parenta45dd7c954345e1f42a29d8485f8d30ccf04ace9 (diff)
downloadhardware_ti_omap4-b69e4dc58ad88dea2908a6583b900661c799e38f.tar.gz
hardware_ti_omap4-b69e4dc58ad88dea2908a6583b900661c799e38f.tar.bz2
hardware_ti_omap4-b69e4dc58ad88dea2908a6583b900661c799e38f.zip
camera: bsa: Fix releasing of threads
Threads in buffer source adapter were not being released correctly, which lead to them being orphaned. Previous logic relied on the Thread destructors getting called to wake up the threads for them to exit, but the destructors were not getting called since it still had child threads. This patch implements the virtual requestExit function for each Thread class. Each implementation wakes its respective thread if it is waiting, so the thread can exit. Change-Id: I95c42a05ce76d6241b073c5927ecb81365562066 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
Diffstat (limited to 'camera/BufferSourceAdapter.cpp')
-rw-r--r--camera/BufferSourceAdapter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/camera/BufferSourceAdapter.cpp b/camera/BufferSourceAdapter.cpp
index b34f8cb..e00cec7 100644
--- a/camera/BufferSourceAdapter.cpp
+++ b/camera/BufferSourceAdapter.cpp
@@ -123,6 +123,8 @@ BufferSourceAdapter::~BufferSourceAdapter()
{
LOG_FUNCTION_NAME;
+ android::AutoMutex lock(mLock);
+
destroy();
if (mFrameProvider) {
@@ -732,7 +734,9 @@ bool BufferSourceAdapter::handleFrameReturn()
void *y_uv[2];
android::Rect bounds(mFrameWidth, mFrameHeight);
- if ( NULL == mBufferSource ) {
+ android::AutoMutex lock(mLock);
+
+ if ( (NULL == mBufferSource) || (NULL == mBuffers) ) {
return false;
}