mEventThreadSemaphore(0),
mSurfaceSemaphore(0),
mUpdateRenderThreadWaitCondition(),
- mPostRenderWaitCondition(),
mAdaptorInterfaces(adaptorInterfaces),
mPerformanceInterface(adaptorInterfaces.GetPerformanceInterface()),
mCore(adaptorInterfaces.GetCore()),
// Start replacing the surface.
{
ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
- mNewSurface = newSurface;
+ mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will replace the surface now
+ mNewSurface = newSurface;
mUpdateRenderThreadWaitCondition.Notify(lock);
}
// Start replacing the surface.
{
ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
+ mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will delete the surface now
mDeletedSurface = surface;
mUpdateRenderThreadWaitCondition.Notify(lock);
}
void CombinedUpdateRenderController::PostRenderComplete()
{
- ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+ ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
mPostRendering = FALSE;
- mPostRenderWaitCondition.Notify(lock);
+ mUpdateRenderThreadWaitCondition.Notify(lock);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void CombinedUpdateRenderController::PostRenderStarted()
{
- ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+ ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
mPostRendering = TRUE;
}
void CombinedUpdateRenderController::PostRenderWaitForCompletion()
{
- ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+ ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
while(mPostRendering &&
!mNewSurface && // We should NOT wait if we're replacing the surface
!mDeletedSurface && // We should NOT wait if we're deleting the surface
!mDestroyUpdateRenderThread)
{
- mPostRenderWaitCondition.Wait(lock);
+ mUpdateRenderThreadWaitCondition.Wait(lock);
}
}