Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Signal to a sleeping Perl program

by ikegami (Patriarch)
on Jan 20, 2020 at 15:56 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-26 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found