MCE-Shared

 view release on metacpan or  search on metacpan

lib/MCE/Hobo.pm  view on Meta::CPAN


   # ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~

   $MCE::_GMUTEX->lock() if ( $_tid && $MCE::_GMUTEX );

   my @args = @_; @_ = ();  # To avoid (Scalars leaked: N) messages
   my ( $killed, $pid );

   {
      local $SIG{TERM} = local $SIG{INT} = sub { $killed = $_[0] }
         if ( !$_is_MSWin32 && $] ge '5.010001' );

      local $SIG{TTIN}, local $SIG{TTOU}, local $SIG{WINCH}
         if ( !$_is_MSWin32 );

      $pid = fork();

      if ( !defined $pid ) {                                # error
         local $\; print {*STDERR} "fork error: $!\n";
      }
      elsif ( $pid ) {                                      # parent

t/07_shared_condvar.t  view on Meta::CPAN


use strict;
use warnings;
use utf8;
use open qw(:std :utf8);

use Test::More;

BEGIN {
   plan skip_all => 'set TEST_CONDVAR to enable this test (developer only)!'
      if ( $^O eq 'MSWin32' && $] lt '5.020000' && !$ENV{'TEST_CONDVAR'} );

   use_ok 'MCE::Hobo';
   use_ok 'MCE::Shared';
   use_ok 'MCE::Shared::Condvar';
}

my $cv = MCE::Shared->condvar();

## One must explicitly start the shared-server for condvars and queues.
## Not necessary otherwise when IO::FDPass is available.



( run in 1.541 second using v1.01-cache-2.11-cpan-cc502c75498 )