Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Signal to a sleeping Perl program

by ikegami (Pope)
on Jan 20, 2020 at 15:56 UTC ( #11111636=note: print w/replies, xml ) Need Help??


in reply to Signal to a sleeping Perl program

Handled signals causes blocking system calls to be interrupted (so the signal can be handled). You need to handle those errors.

sub uninterruptible_sleep { my $sleep_until = time() + $_[0]; while (1) { my $time_left = $sleep_until - time(); return if $time_left <= 0; sleep($time_left); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2021-10-17 01:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (70 votes). Check out past polls.

    Notices?