[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
{
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 );
{
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" );