- or download this
#!/usr/bin/perl
use strict;
...
say "helper ends";
exit(0);
}
- or download this
>env - perl interrupted.pl
Sun May 24 20:24:11 2015 pid=31389: main starts
Sun May 24 20:24:11 2015 pid=31389: main waiting for helper to lock
...
alex@enterprise pts/0 20:24:49
/home/alex/tmp/lockdemo>
- or download this
>env - PERL_SIGNALS=unsafe strace -o trace.txt /usr/bin/perl interrupt
+ed.pl
Sun May 24 20:39:02 2015 pid=31774: helper starts
...
write(2, "SIGALRM in main at interrupted.p"..., 43) = 43
>
- or download this
>env - PERL_SIGNALS=unsafe strace -o trace.txt /usr/bin/perl interrupt
+ed.pl
Sun May 24 20:51:14 2015 pid=32083: helper starts
Sun May 24 20:51:14 2015 pid=32082: main starts
...
rt_sigaction(SIGSTOP, NULL, {SIG_DFL, [], 0}, 8) = 0
>
- or download this
#ifdef SA_RESTART
if (PL_signals & PERL_SIGNALS_UNSAFE_FLAG)
act.sa_flags |= SA_RESTART; /* SVR4, 4.3+BSD */
#endif