[Interest] Connecting signal handler to Qt application - async-handler-safety

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Jun 16 12:36:31 CEST 2020


Il 15/06/20 18:12, Thiago Macieira ha scritto:
> No, you can't, because you need to block the signal using pthread_sigmask in
> all threads, otherwise the kernel may prefer delivering the signal instead of
> using the signalfd. Qt has a few background threads (like the QHostInfo thread
> pool) that you don't have access to.
> 
> signalfd is a misfeature. Don't use it.

It's very unfortunate that signalfd wants to read a pending signal, 
rather than being a "special" signal handler that overrides the 
dispositions. You may get away with installing it before spawning any 
other thread. But then again, threads+signals+libraries don't exactly 
mix well together...

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200616/d67dba5c/attachment.bin>


More information about the Interest mailing list