Commit 3f792f4b authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

bool + mutex -> atomic_bool

parent 2d325074
Pipeline #114717 passed with stage
in 2 minutes
......@@ -59,10 +59,7 @@ RenderingThread::RenderingThread( KAbstractCardDeckPrivate * d, QSize size, cons
void RenderingThread::halt()
{
{
QMutexLocker l( &m_haltMutex );
m_haltFlag = true;
}
m_haltFlag = true;
wait();
}
......@@ -77,11 +74,8 @@ void RenderingThread::run()
const auto size = m_size * qApp->devicePixelRatio();
for (const QString & element : qAsConst(m_elementsToRender)) {
{
QMutexLocker l( &m_haltMutex );
if ( m_haltFlag )
return;
}
if ( m_haltFlag )
return;
QString key = keyForPixmap( element, size );
if ( !d->cache->contains( key ) )
......
......@@ -52,8 +52,7 @@ private:
KAbstractCardDeckPrivate * const d;
const QSize m_size;
const QStringList m_elementsToRender;
bool m_haltFlag;
QMutex m_haltMutex;
std::atomic_bool m_haltFlag;
};
......
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