forked from organicmaps/organicmaps-tmp
Fixed deadlock on entering background/foreground
This commit is contained in:
parent
838578602c
commit
d95070104d
3 changed files with 9 additions and 1 deletions
|
@ -59,6 +59,11 @@ void BaseRenderer::SetRenderingEnabled(bool const isEnabled)
|
|||
completionCondition.wait(lock, [¬ified] { return notified; });
|
||||
}
|
||||
|
||||
bool BaseRenderer::IsRenderingEnabled() const
|
||||
{
|
||||
return m_isEnabled;
|
||||
}
|
||||
|
||||
void BaseRenderer::SetRenderingEnabled(bool const isEnabled, TCompletionHandler completionHandler)
|
||||
{
|
||||
if (isEnabled == m_isEnabled)
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
bool CanReceiveMessages();
|
||||
|
||||
void SetRenderingEnabled(bool const isEnabled);
|
||||
bool IsRenderingEnabled() const;
|
||||
|
||||
protected:
|
||||
ref_ptr<ThreadsCommutator> m_commutator;
|
||||
|
|
|
@ -1420,7 +1420,9 @@ void FrontendRenderer::Routine::Do()
|
|||
if (activityTimer.ElapsedSeconds() > kMaxInactiveSeconds)
|
||||
{
|
||||
// Process a message or wait for a message.
|
||||
m_renderer.ProcessSingleMessage();
|
||||
// IsRenderingEnabled() can return false in case of rendering disabling and we must prevent
|
||||
// possibility of infinity waiting in ProcessSingleMessage.
|
||||
m_renderer.ProcessSingleMessage(m_renderer.IsRenderingEnabled());
|
||||
activityTimer.Reset();
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue