No, "it didn't work" for you because you killed the program before the signal handler was called.
In reply to Re^7: Print inside SIGNALS by ikegami in thread Print inside SIGNALS by pedrete