Hi

I am having problems catching unix signals in a multithreaded application. The signals are caught fine unless I start a thread at which point the default signal handling occurs.

To create signal handlers I am using the following code which is located in main:
Qt Code:
  1. signal(SIGINT, shutdown);
To copy to clipboard, switch view to plain text mode 

This should cause the shutdown function to run on a SIGINT, however when I start a thread the above no longer works as expected. The following code is being used to start the thread:
Qt Code:
  1. XmlRpcServer* xmlServer = new XmlRpcServer;
  2. QThread xmlServerThread;
  3. xmlServer->moveToThread(&xmlServerThread);
  4. xmlServer->connect(&xmlServerThread,
  5. SIGNAL(started()),
  6. SLOT(startServer()));
  7. xmlServerThread.start();
To copy to clipboard, switch view to plain text mode 

I'd be grateful for any advice anyone can offer as this has been stumping me for a while.