Handled signals. See if you can use thread cancelation and not signals.