Only decrement the "update ahead" counter after Core::Render() 11/49711/2
authorPaul Wisbey <p.wisbey@samsung.com>
Mon, 19 Oct 2015 10:48:42 +0000 (11:48 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Mon, 19 Oct 2015 10:50:31 +0000 (11:50 +0100)
commit045cd813a0599c81fbb03a8547a55dff46f49d5a
tree05643607e60d23c6e0326b5a64b6683a19701007
parent2841614fc8febcab92b5cfbbde7cb394141f6e5c
Only decrement the "update ahead" counter after Core::Render()

The issue:

Inside RenderThread::Run() it loops inside: while( mThreadSynchronization.RenderReady( request ) )
In normal usage mCore.Render() is called for each tick, before waiting again in ThreadSynchronization::RenderReady()
RenderReady() decrements mUpdateAheadOfRender, which counts how many frames ahead the update thread is (max of 2)
However in some scenario it skips the mCore.Render(), and still continues to decrement mUpdateAheadOfRender

The solution is to only decrement mUpdateAheadOfRender if Core::Render() has been called

Change-Id: I20dd3ad5b8055b7191397aa101aa5b88f632fe32
adaptors/base/render-thread.cpp
adaptors/base/thread-synchronization.cpp
adaptors/base/thread-synchronization.h