Update: Same behaviour with Perl 5.8 under Solaris 10...use threads; use threads::shared; $SIG{'HUP'}='switchFlag'; $flag::shared; my $thr=threads->new(\&printer); $thr->detach(); sleep 10000; print "I am here\n"; exit; sub printer{ while(1) { sleep 1; print "Shared: $flag\n"; } } sub switchFlag{ $flag=!$flag; print "signal caught"; $SIG{'HUP'}='switchFlag'; }
In reply to Catching signals under Linux by weismat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |