At 1:38 AM -0700 7/14/05, Michael G Schwern via RT wrote:
 > [elizabeth - Wed Aug 28 02:01:38 2002]:

 This shows it all:

 == alarm ========================================================
 use threads;
 $SIG{ALRM} = 'a' if @ARGV; # must assign outside of threads
 threads->new( sub {
    $SIG{ALRM} = sub { die "alarm went off properly\n" };
    eval {
      alarm( 3 );
      1 while 1;
      alarm( 0 );
    };
    warn "\$\@ = $@";
 } )->join;
 =================================================================

   $ perl alarm 1
   $@ = alarm went off properly

   $ perl alarm
   Alarm clock

0 ~$ bleadperl ~/tmp/test Alarm clock
0 ~$ bleadperl ~/tmp/test 1
...hang...

Is that an improvement? :)  That's [EMAIL PROTECTED] on OS X 10.3.9

To be quite honest, I've given up on threads in Perl 5.

Signals and threads in Perl are the Wild West, really, last time I checked....

Reply via email to