Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
KPat
Commits
3f792f4b
Commit
3f792f4b
authored
Dec 27, 2021
by
Albert Astals Cid
Browse files
bool + mutex -> atomic_bool
parent
2d325074
Pipeline
#114717
passed with stage
in 2 minutes
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/libkcardgame/kabstractcarddeck.cpp
View file @
3f792f4b
...
...
@@ -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
)
)
...
...
src/libkcardgame/kabstractcarddeck_p.h
View file @
3f792f4b
...
...
@@ -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
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment