[Qt-interest] Proper way to terminate QThreads

Thiago Macieira thiago at kde.org
Tue Nov 17 20:27:43 CET 2009


Em Terça-feira 17 Novembro 2009, às 19:06:37, você escreveu:
> Thanks for the one example - and while true that would work in that
>  example, how does it work when each thread has its own Event Loop?
> 
> All my threads execute exec() in their run() - they all use the event loop;
>  that's the only way to get the signals/slots going and fully working -
>  which is one of things I am highly interested in.

Hi Ben

Calling quit() from any thread is thread-safe. That will cause the event loop 
to exit at the earliest opportunity. The control will return to the run() 
function, which should just return at that point.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091117/d0c38158/attachment.bin 


More information about the Qt-interest-old mailing list