in reply to Re: Why does threads::join block SIGALRM
in thread Why does threads::join block SIGALRM
The behavior is similar with the forks module.
use strict; use warnings; use forks; sub worker { print "Worker thread started.\n"; while(1){} } my $proc = threads->create(\&worker); print "Setting alarm.\n"; $SIG{ALRM} = sub { print "Alarm!\n" }; alarm 2; print "Joining.\n"; $proc->join();
Output
Setting alarm. Joining. Worker thread started. Alarm!
Kind regards, Mario.
|
|---|