Commit 04fca98f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Fix idle state propagation

parent 782a6148
......@@ -705,7 +705,9 @@ void MediaLibrary::onDiscovererIdleChanged( bool idle )
bool expected = !idle;
if ( m_discovererIdle.compare_exchange_strong( expected, idle ) == true )
{
if ( m_parserIdle == idle )
// If any idle state changed to false, then we need to trigger the callback.
// If switching to idle == true, then both background workers need to be idle before signaling.
if ( idle == false || m_parserIdle == true )
m_callback->onBackgroundTasksIdleChanged( idle );
}
}
......@@ -715,7 +717,7 @@ void MediaLibrary::onParserIdleChanged( bool idle )
bool expected = !idle;
if ( m_parserIdle.compare_exchange_strong( expected, idle ) == true )
{
if ( m_discovererIdle == idle )
if ( idle == false || m_discovererIdle == true )
m_callback->onBackgroundTasksIdleChanged( idle );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment