[Qt-interest] Cleanly exit Qt app with <CTRL-C> from Linux console
Markus Franke
Franke.M at sebakmt.com
Thu Dec 23 14:55:19 CET 2010
Hi Jorge,
qt-interest-bounces+franke.m=sebakmt.com at qt.nokia.com schrieb am
23.12.2010 13:24:08:
> I think this is not related to signals but to objects being destroyed at
main
> exit. Are you creating some kind of blocking objects (sockets, database
> connections)? do you have threads? if so is the message "... x threads
didn't
> exit" being printed?
Bingo! It had something to do with an open connection. I am using a serial
port within my application. On <CTRL-C> the close() method is called on
the /dev/ttyS* device. It turned out that this close() call took exactly
30 seconds to finish. I tracked the problem down to some kernel code in
<linux>/drivers/char/tty_ioctl.h:tty_wait_until_sent(). There a timeout of
30 seconds has been declared.
Don't know why this happens but it turned out that as soon as I disable
flow control by means of RTS/CTS the problem disappears.
Any comments on this?
Anyway, thanks for your help and wish you a merry christmas.
Markus
"Disclaimer: This message is intended only for the use of the individual
or entity to
which it is addressed and may contain information which is privileged,
confidential, proprietary,
or exempt from disclosure under applicable law. If you are not the
intended recipient or the person
responsible for delivering the message to the intended recipient, you are
strictly prohibited from
disclosing, distributing, copying, or in any way using this message. If
you have received this
communication in error, please notify the sender and destroy and delete
any copies you may have
received."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101223/adc0a52d/attachment.html
More information about the Qt-interest-old
mailing list