Show
Ignore:
Timestamp:
04/03/08 17:03:42 (7 years ago)
Author:
kazuho
Message:

add received_signal function

Location:
lang/perl/Parallel-Prefork/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Parallel-Prefork/trunk/lib/Parallel/Prefork.pm

    r8758 r8764  
    55 
    66use base qw/Class::Accessor::Fast/; 
     7use List::Util qw/first/; 
    78use Proc::Wait3; 
    89 
     
    7980} 
    8081 
     82sub received_signal { 
     83    my ($self, @signames) = @_; 
     84    foreach my $rs (@{$self->signals_received}) { 
     85        return 1 if first { $_ eq $rs } @signames; 
     86    } 
     87    undef; 
     88} 
     89 
    81901; 
    8291 
  • lang/perl/Parallel-Prefork/trunk/t/01-base.t

    r8754 r8764  
    2727my $c; 
    2828 
    29 while (! @{$pm->signals_received}) { 
     29until ($pm->received_signal('TERM')) { 
    3030    $pm->start and next; 
    3131    open $fh, '+<', $filename