in reply to Call Intercepts
You weren't clear on what behaviour you are getting and what behaviour you were expecting, but I think you're complaining about your operations getting interrupted by signals. That's a must for signals to be useful.
However, nothing is stopping you from checking if your blocking operations (sleep, flock) got interrupted and restarting them when they are.
use Errno qw( EINTR ); sub unint_flock(*$) { for (;;) { return if flock($_[0], $_[1]) || $! != EINTR; } } sub unint_sleep($) { my $sleep_til = time + $_[0]; for (;;) { my $sleep_dur = time - $sleep_til; last if $sleep_dur <= 0; sleep($sleep_dur); } }
This is a separate issue from the serious problem almut pointed out.
|
|---|