Re: [Interest] Terminating a QThread

2013-06-22 Thread Etienne Sandré-Chardonnal
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

[Interest] Terminating a QThread

2013-06-21 Thread francois cellier
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

Re: [Interest] Terminating a QThread

2013-06-21 Thread Mandeep Sandhu
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

Re: [Interest] Terminating a QThread

2013-06-21 Thread Etienne Sandré-Chardonnal
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

Re: [Interest] Terminating a QThread

2013-06-21 Thread francois cellier
: [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

Re: [Interest] Terminating a QThread

2013-06-21 Thread André Somers
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

Re: [Interest] Terminating a QThread

2013-06-21 Thread francois cellier
. 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

Re: [Interest] Terminating a QThread

2013-06-21 Thread Tony Rietwyk
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