From ac92e98a4a2f032f731fb9d207ce4268771c92c1 Mon Sep 17 00:00:00 2001 From: Andrew Cox Date: Tue, 24 Jun 2014 11:24:06 +0100 Subject: [PATCH] Disable Late-cancels of in-flight resource loads using boost::thread interrupt() Change-Id: I992d18a8f33582bf9c6f769e9244edc86a2d3153 Signed-off-by: Andrew Cox Signed-off-by: Adeel Kazmi --- .../slp/resource-loader/resource-thread-base.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform-abstractions/slp/resource-loader/resource-thread-base.cpp b/platform-abstractions/slp/resource-loader/resource-thread-base.cpp index 248eb93..41c65ca 100644 --- a/platform-abstractions/slp/resource-loader/resource-thread-base.cpp +++ b/platform-abstractions/slp/resource-loader/resource-thread-base.cpp @@ -96,12 +96,12 @@ void ResourceThreadBase::CancelRequest( Integration::ResourceId resourceId ) unique_lock lock( mMutex ); // See if the request is already launched as the current job on the thread: - if( mCurrentRequestId == resourceId ) - { - mThread->interrupt(); - } + //if( mCurrentRequestId == resourceId ) + //{ + // mThread->interrupt(); + //} // Check the pending requests to be cancelled: - else + //else { for( RequestQueueIter iterator = mQueue.begin(); iterator != mQueue.end(); @@ -164,6 +164,8 @@ void ResourceThreadBase::ThreadLoop() // No problem, thread was just interrupted from the outside to cancel an in-flight request. boost::thread_interrupted* disableUnusedVarWarning = &ex; ex = *disableUnusedVarWarning; + // Temporary logging of an unexpected boost::thread_interrupted exception: + DALI_LOG_ERROR( "boost::thread_interrupted caught in resource thread in build with late cancellation disabled (should not happen). Aborting request with id %u.\n", unsigned(mCurrentRequestId) ); } // Since we have an exception handler here anyway, lets catch everything to avoid killing the process: -- 2.7.4