From: Adeel Kazmi Date: Wed, 19 Aug 2015 18:00:31 +0000 (+0100) Subject: Ensure we don't wait for VSync if we're just resuming X-Git-Tag: dali_1.1.1~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a02b19b17ee3c4fe75bc23037aaced8414c3bc1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Ensure we don't wait for VSync if we're just resuming [Problem] Could go into a scenario where we end up waiting for v-sync but haven't actually restarted the v-sync thread upon resume. [Solution] Ensure we do not wait for a v-sync if we're just resuming. Also ensure we do not go to sleep if we've just resumed. Change-Id: I225c78c9c20fee090db0842e40b02336821b75a6 --- diff --git a/adaptors/base/thread-synchronization.cpp b/adaptors/base/thread-synchronization.cpp index 8a27ecb..191d3e9 100644 --- a/adaptors/base/thread-synchronization.cpp +++ b/adaptors/base/thread-synchronization.cpp @@ -385,7 +385,8 @@ bool ThreadSynchronization::UpdateReady( bool notifyEvent, bool runUpdate, float { ConditionalWait::ScopedLock updateLock( mUpdateThreadWaitCondition ); if( ( mState != State::STOPPED ) && - ( mVSyncAheadOfUpdate == 0 ) ) + ( mVSyncAheadOfUpdate == 0 ) && + ( !mUpdateThreadResuming ) ) // Ensure we don't wait if the update-thread is JUST resuming { LOG_VSYNC_COUNTER_UPDATE( " vSyncAheadOfUpdate(%d) WAIT", mVSyncAheadOfUpdate ); mUpdateThreadWaitCondition.Wait( updateLock ); @@ -626,7 +627,8 @@ void ThreadSynchronization::UpdateTryToSleep( bool runUpdate ) { LOG_UPDATE_TRACE; - if( ! runUpdate ) + if( ! runUpdate && + ! IsUpdateThreadResuming() ) // Locks so we shouldn't have a lock, we shouldn't try to sleep if we're JUST resuming { LOG_UPDATE( "TryToSleep" );