Except in this particular case where:
- The flag is set to false at the start of the thread
- Set to true for stopping by the controlling(parent) thread (writen,
never read)
- Checked by the thread as a quit condition (read, never written)
In that case, there is absolutely no possible race
Dear all,
Even if I know that it can be dangerous to terminate a thread, I need to do it
for my application.
The function that run into the thread is like a long linear sequence of code
that has not been designed in a signal/slot way. Moreover, in my thread, I need
an eventloop as I use in it
On Fri, Jun 21, 2013 at 1:36 PM, francois cellier f_cell...@yahoo.frwrote:
Dear all,
Even if I know that it can be dangerous to terminate a thread, I need to
do it for my application.
The function that run into the thread is like a long linear sequence of
code that has not been designed in
Sorry Mandeep, I didn't read your post first. Basically what I posted is
similar.
A mutex is a little bit overkill here, you could use an atomic variable if
you want to be sure, but just a bool flag will be enough as it is always
set atomically AFAIK
2013/6/21 Mandeep Sandhu
: [Interest] Terminating a QThread
Sorry Mandeep, I didn't read your post first. Basically what I posted is
similar.
A mutex is a little bit overkill here, you could use an atomic variable
if you want to be sure, but just a bool flag will be enough as it is
always set atomically AFAIK
2013/6/21
Op 21-6-2013 10:06, francois cellier schreef:
Dear all,
Even if I know that it can be dangerous to terminate a thread, I need
to do it for my application.
Are you really going to completely re-do the discussion you already had
on the qt-project.org forums?
André
--
You like Qt?
I am
.
I was just hoping that someone that knows well QThread would help me to
understand.
François
De : André Somers an...@familiesomers.nl
À : interest@qt-project.org
Envoyé le : Vendredi 21 juin 2013 14h12
Objet : Re: [Interest] Terminating a QThread
Op 21
2013 9:01 PM
Cc: interest@qt-project.org
Subject: Re: [Interest] Terminating a QThread
Sorry Mandeep, I didn't read your post first. Basically what I posted is
similar.
A mutex is a little bit overkill here, you could use an atomic variable if you
want to be sure, but just a bool flag