The Safe author(s) had 3 options: 1) Temporarily block usr1,2 and do nothing and wait for caller to figure it out later, 2)throw these signals away, 3)do something of its own which probably ain't that polite.
One possible? solution is to block Usr1 and Usr2 before calling Safe, but that requires C code and requires Safe to be "well behaved". I don't know of anyway in Perl to modify the signal mask. In this case to not miss a signal, caller then re-installs the signal handlers and then unblocks the signals. Then any pending signal would be delivered. It is possible for the OS to have a "pending, but not delivered" signal.
A big issues here is "how well behaved" Safe is? Sounds like its not very "polite". If it installs its own handlers but doesn't unblock the USR signals and essentially "take over the world", then that can be worked around with effort.
Just re-installing the signal handlers after the call to Safe will work with the exception of what happens while Safe is running. It appears to me that not everything is "safe" with Safe. A signal might not just be delayed, but missed which is different.
I did look at the Safe doc's and it appears to me that this thing would flunk the Kindergarten grade of "plays well with others".
In reply to Re^5: trouble with custom signal handlers
by Marshall
in thread trouble with custom signal handlers
by casaschi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |