I have a Qthread that is started using start() from the main GUI and has code in the run() method that sleeps on a message queue looking for a particular message. If the user exits the application, I call the thread's stop() method which toggles a "run" variable and returns. The main GUI then calls the thread's wait() method which waits forever.

The reason the main GUI waits forever is that the thread is sleeping in msgrcv() and there is nothing in my code presently to cause it to wake up. The man page says that it will only wake up if it sees the message that it is looking for, has the message queue removed from underneath it, or receives a signal that it can't ignore.

The first condition may or may not happen, but its unreliable at best for waking up the thread.

The second is not feasible as it would wreak havoc on the rest of my application.

The third condition is most likely the route I need to take. So how does one send a linux signal like SIGHUP or SIGKILL to a QThread from the main GUI?

Thanks,

-Mic