[Interest] QThread and sleep

Hugo Drumond Jacob hugo at jacob.eng.br
Tue Mar 19 19:15:31 CET 2013


2013/3/19 Thiago Macieira <thiago.macieira at intel.com>:
> On terça-feira, 19 de março de 2013 14.56.47, Hugo Drumond Jacob wrote:
>> No problem! In fact, we are using!  It's just a question about
>> QThread::wait and QThread::sleep: "It's safe use QThread::wait in
>> other situation that not synchronously QThread::terminate ?" and you
>> already answered: yes. Maybe not for this point of our application in
>> specific, but is normal usage.
>
> They are two very different methods and do not do remotely the same thing.
> Asking about the two together in the same breath would suggest that you do not
> understand what they are or what you're trying to do.
>
> Anyway, QThread::wait() is perfectly safe to use. It's QThread::terminate()
> that is not safe.

Yes! I agree: "QThread::wait and QThread::terminate are two very
different methods and do not do remotely the same thing.". I'm asking
about QThread::wait and QThread::sleep, but, Qt documentation suggest
"Use QThread::wait() after terminate() for synchronous termination.".
Some careless reader can understand "ONLY use QThread::wait() after
QThread::terminate()". As you say, it's safe (but not recommended) use
QThread::wait().

Whatever, the doubt was clarified.

Thank you very much again!

>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list