[Qt-interest] Interesting QThread problem
Thiago Macieira
thiago at kde.org
Tue Nov 23 23:39:20 CET 2010
On Tuesday, 23 de November de 2010 23:18:57 Yifei Li wrote:
> The following code is a minimal example of what I'm trying to do. Once the
> plugin prints out one message, it will wait until 'Next' button is clicked
> to print out the next message. Try to terminate the execution by clicking
> 'Stop' and then start the execution. You will notice the first message is
> printed out fine. But when you click on 'Next' button to print the second
> message, the whole app seems to deadlock.
That's to be expected. Calling QThread::terminate() is a forceful termination
and will probably leave behind locked mutexes and other resources.
Solution: don't use terminate.
--
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/20101123/7a6b30ff/attachment.bin
More information about the Qt-interest-old
mailing list