in reply to Re: Send signal to main thread
in thread Send signal to main thread
When using threads, catching a Ctrl-C to close up your program gracefully is a nightmare.
While threads signals may work fine, catching signals from the terminal, such as Ctrl-C, still poses a difficult problem with no good solution (that I've encountered). There is no way to know which thread is going to receive the signal because the terminal sends the signal to the process group, not to a thread.
|
|---|