[Interest] proper (silent) exit in response to SIGHUP - and signal/slot serialisation?
René J.V. Bertin
rjvbertin at gmail.com
Fri Oct 19 10:39:46 CEST 2018
Does Qt serialise slot calling, iow, will it queue signals emitted and deliver newer ones only when the previous slot invocation completed?
Qt::QueuedConnection does kind of suggest it might, which begs the question if there's a way around that in this situation?
Context: my graceful exit procedure is designed to trigger a somewhat less graceful exit when a 2nd signal is delivered, for instance when the graceful procedure blocks (thing unresponsive remote X server). This is implemented with a simple std::atomic_bool state variable.
When using an unspecified connect from the QSocketNotifier signal to my graceful exit procedure that principle doesn't seem to work, and even with something like `kill -2 $PID ; kill -1 $PID` it is like the 2nd signal is never delivered.
I can fix that by forcing a Qt::DirectConnection, which seems to be signal safe (according to a sig_atomic_t state "inSignalHandler" var) but is it?
More information about the Interest