Do you really not get "Waiting for critical tasks to finish before terminating program"? That would mean your signal handler isn't called at all.
Either way, I already gave a reason the current code won't always work. Executing the signal handler will prevent (at least) that thread from doing anything else. If the signal handler is called from a thread1 thread, that thread1 thread won't be able to progress.
In reply to Re^3: Interrupt Handling - What am I doing wrong?
by ikegami
in thread Interrupt Handling - What am I doing wrong?
by vishi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |