From: Adeel Kazmi Date: Wed, 25 Nov 2015 09:46:10 +0000 (+0000) Subject: (Image Atlas) Fix helgrind simultaneous access issue X-Git-Tag: dali_1.1.12~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=89e63b880b582ed7fddf40330136d2f2452b833b;ds=sidebyside (Image Atlas) Fix helgrind simultaneous access issue Change-Id: I948c61ab962bd1469cafae82c7ee5c8709c722f0 --- diff --git a/dali-toolkit/internal/image-atlas/image-load-thread.cpp b/dali-toolkit/internal/image-atlas/image-load-thread.cpp index d106690..c7da85b 100644 --- a/dali-toolkit/internal/image-atlas/image-load-thread.cpp +++ b/dali-toolkit/internal/image-atlas/image-load-thread.cpp @@ -87,14 +87,14 @@ CompleteQueue::~CompleteQueue() LoadingTask* CompleteQueue::NextTask() { - while( mTasks.Empty() ) + // Lock while popping task out from the queue + Mutex::ScopedLock lock( mMutex ); + + if( mTasks.Empty() ) { return NULL; } - // Lock while popping task out from the queue - Mutex::ScopedLock lock( mMutex ); - Vector< LoadingTask* >::Iterator next = mTasks.Begin(); LoadingTask* nextTask = *next; mTasks.Erase( next );