Disable Late-cancels of in-flight resource loads using boost::thread interrupt() 33/24133/1
authorAndrew Cox <andrew.cox@partner.samsung.com>
Tue, 24 Jun 2014 10:24:06 +0000 (11:24 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 16:01:40 +0000 (17:01 +0100)
Change-Id: I992d18a8f33582bf9c6f769e9244edc86a2d3153
Signed-off-by: Andrew Cox <andrew.cox@partner.samsung.com>
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
platform-abstractions/slp/resource-loader/resource-thread-base.cpp

index 248eb93..41c65ca 100644 (file)
@@ -96,12 +96,12 @@ void ResourceThreadBase::CancelRequest( Integration::ResourceId resourceId )
     unique_lock<mutex> 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: