Branch Coverage

blib/lib/MCE/Shared/Server.pm
Criterion Covered Total %
branch 191 674 28.3


line true false branch
37 46 0 if not $INC{'IO/FDPass.pm'} and $^O ne "cygwin"
39 0 46 $INC{'threads.pm'} ? :
41 46 0 unless ($INC{'PDL.pm'})
43 46 0 unless ($@)
46 46 0 if ($_encoder_ver - $_decoder_ver == 0)
53 0 46 if (not defined $_freeze)
76 0 46 $^O eq 'solaris' ? :
0 46 $INC{'POSIX.pm'} ? :
133 0 0 if $INC{'threads.pm'}
137 0 0 if $_is_MSWin32 and $MCE::Signal::KILLED
139 15 31 if $_init_pid and $_init_pid eq "$$.$_tid" and $_is_client
147 34 130 unless ($_svr_pid)
151 0 34 if $_has_fh and not $INC{'IO/FDPass.pm'}
156 32 132 if ($_has_fh)
159 0 32 unless $INC{'IO/FDPass.pm'}
165 64 320 if (defined $_[1]{$_k})
188 0 164 if defined $\
189 0 164 if $/ ne $LF
191 0 164 $_is_MSWin32 ? :
194 32 132 keys %_hndls ? :
201 32 132 if (keys %_hndls)
203 58 70 if (exists $_hndls{$_k})
213 164 0 if $_len
215 164 0 unless $_is_MSWin32
217 0 164 unless $_len
219 32 132 if (keys %_hndls)
224 162 2 unless ($_deeply)
226 0 162 $_tid ? :
233 0 0 unless $_svr_pid
240 0 0 if defined $\
241 0 0 if $/ ne $LF
246 0 0 $_is_MSWin32 ? :
252 0 0 unless $_is_MSWin32
255 0 0 if $MCE::Signal::SIG
265 0 0 if ($_class eq ':construct_module:') { }
0 0 elsif ($_class eq ':construct_pdl:') { }
267 0 0 @{$_item;} ? :
272 0 0 unless MCE::Shared::_use($_class = $_module)
274 0 0 unless eval " $_module->can('${_fcn}') "
277 0 0 unless $_item = $_module->$_fcn(@{$_item;})
279 0 0 if $_class->isa("Graphics::Framebuffer")
280 0 0 if $_fcn eq "TIEHANDLE"
282 0 0 if $_has_args and $_fcn eq "TIEHANDLE" and not defined fileno $_item
323 0 0 if ($_class eq 'MCE::Shared::Handle' and &reftype($_item) eq 'ARRAY') { }
332 0 0 if (&reftype($_obj{$_id}) eq "HASH" and &reftype($_obj{$_id}{'fh'}) eq "GLOB")
335 0 0 if ($_class->isa("Tie::File"))
349 0 0 if ($_params->{'tied'})
352 0 0 if $_class->isa($_module)
354 0 0 if $self->[2]
361 51 46 if $_svr_pid
363 0 46 if ($INC{'PDL.pm'})
365 0 0 unless $INC{'PDL/IO/Storable.pm'}
374 46 0 $_init_pid eq $_oid ? :
383 0 46 if $^O ne "aix" and $^O ne "linux"
386 0 46 if ($_is_MSWin32) { }
400 46 0 unless $_is_MSWin32
402 46 0 if ($_spawn_child) { }
404 0 46 if defined $_svr_pid and $_svr_pid == 0
408 0 0 if defined $_svr_pid
411 0 46 unless defined $_svr_pid
414 0 46 if not $_spawn_child or $_is_MSWin32
421 0 15 unless $_is_client and $_init_pid and $_init_pid eq "$$.$_tid"
423 0 15 if $INC{'MCE/Child.pm'}
424 3 12 if $INC{'MCE/Hobo.pm'}
428 15 0 if (defined $_svr_pid)
431 0 15 if (ref $_svr_pid) { }
441 0 15 if defined $\
446 15 15 if waitpid $_svr_pid, 1
447 0 15 if (&MCE::Shared::Server::time() - $_start > "0.7")
472 0 0 ref $_svr_pid ? :
479 0 0 if exists $_ob3{"${_id}:count"} and --$_ob3{"${_id}:count"} > 0
482 0 0 if exists $_lkup->{$_id}
486 0 0 if (exists $_ob3{"${_id}:deeply"}) { }
0 0 elsif (exists $_obj{$_id}) { }
493 0 0 if ($_obj{$_id}->isa('MCE::Shared::Scalar') or $_obj{$_id}->isa('Tie::StdScalar')) { }
0 0 elsif ($_obj{$_id}->isa('Tie::File')) { }
0 0 elsif ($_obj{$_id}->can('sync')) { }
0 0 elsif ($_obj{$_id}->can('db_sync')) { }
0 0 elsif ($_obj{$_id}->can('close')) { }
0 0 elsif ($_obj{$_id}->can('DESTROY')) { }
0 0 elsif (&reftype($_obj{$_id}) eq 'GLOB') { }
496 0 0 if (&blessed(scalar $_item->FETCH))
509 0 0 if defined fileno $_obj{$_id}
513 0 0 if exists $_obj{$_id}
514 0 0 if exists $_itr{$_id}
529 0 0 unless $_tid
535 0 0 if ($_obj{$_id}->isa('Tie::File')) { }
0 0 elsif ($_obj{$_id}->can('sync')) { }
0 0 elsif ($_obj{$_id}->can('db_sync')) { }
0 0 elsif ($_obj{$_id}->can('close')) { }
0 0 elsif ($_obj{$_id}->can('DESTROY')) { }
0 0 elsif (&reftype($_obj{$_id}) eq 'GLOB') { }
541 0 0 if defined fileno $_obj{$_id}
550 0 0 if exists $_export_nul{$_all{$_id}}
555 0 0 if (not $_spawn_child and $_is_MSWin32 || $INC{'Tk.pm'} || $INC{'Wx.pm'})
559 0 0 if not $_spawn_child or $_is_MSWin32
561 0 0 unless $_is_MSWin32
568 0 0 if $MCE::MCE and $MCE::MCE->{'_wid'} == 0
574 0 0 if $_init_pid eq $_oid
577 0 0 if $_spawn_child and not $_is_MSWin32
579 0 0 if $_init_pid eq $_oid and not $_is_MSWin32
580 0 0 if $_init_pid eq $_oid and not $_spawn_child
583 0 0 if (not defined $^S or $^S)
584 0 0 if ($INC{'threads.pm'} and 'threads'->tid != 0 or $ENV{'PERL_IPERL_RUNNING'} or $_running_inside_eval) { }
590 0 0 if $_t =~ /^(?:[^\n]+\n){1,7}\teval / or $_t =~ /\n\teval [^\n]+\n\t(?:eval|Try)/
601 0 0 defined $_[0] ? :
603 0 0 $_spawn_child && !$_is_MSWin32 ? :
616 0 0 if ($_wa == 1)
631 0 0 if $_obj->isa("Tie::StdHash")
632 0 0 unless $_obj->can("FIRSTKEY")
634 0 0 if (wantarray) { }
0 0 elsif ($_obj->isa('Tie::ExtraHash')) { }
0 0 elsif ($_obj->isa('Tie::IxHash')) { }
636 0 0 if (defined $_key)
652 0 0 if (defined $_key)
661 0 0 wantarray ? :
665 0 0 unless (exists $_itr{$_id})
668 0 0 $pkg->can('NEXTKEY') || $pkg->can('keys') ? :
669 0 0 $pkg->can('get') ? :
0 0 $pkg->can('FETCH') ? :
671 0 0 unless ($flg || $pkg->can('FETCHSIZE') and $get)
679 0 0 if $pkg->isa("MCE::Shared::Cache")
681 0 0 if (not exists $_itr{"${_id}:args"}) { }
684 0 0 $pkg->can('keys') ? :
688 0 0 if (@{$_args;} == 1 and $_args->[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
691 0 0 if $pkg->isa("MCE::Shared::Base::Common")
695 0 0 if $pkg->isa("MCE::Shared::Cache")
702 0 0 unless defined $_key
714 0 0 if ($_wa)
740 0 0 if ($_len)
744 0 0 if (exists $_args->[0]{$_k})
747 0 0 unless $_fd >= 0
750 0 0 unless open $_args->[0]{$_k}, "+<&=$_fd"
758 0 0 unless ($_item = _share($_params, @{$_args;}))
768 0 0 if ($_class eq 'MCE::Shared::Queue') { }
0 0 elsif (&reftype($_obj{$_item->[0]}) eq 'GLOB') { }
0 0 elsif ($_class eq 'MCE::Shared::Condvar') { }
771 0 0 if $INC{'MCE/Shared/Queue.pm'}
776 0 0 if $INC{'MCE/Shared/Handle.pm'}
781 0 0 if $INC{'MCE/Shared/Condvar.pm'}
789 0 0 if $_channel_id >= $_SVR->{'_data_channels'}
823 0 0 $_wa ? :
825 0 0 if $@
848 0 0 if ($_wa == 1) { }
0 0 elsif ($_wa) { }
862 0 0 if $@
875 0 0 exists $_all{$_id} ? :
876 0 0 if $_ret
888 0 0 if $_len
890 0 0 if (exists $_obj{$_id}) { }
894 0 0 if (exists $_export_nul{$_all{$_id}})
900 0 0 if ($_obj{$_id}->can('clone')) { }
903 0 0 $_len ? :
925 0 0 if (my $_code = $_var->can('next')) { }
944 0 0 if (my $_code = $_var->can('rewind')) { }
948 0 0 if exists $_itr{$_id}
950 0 0 if (@_args) { }
963 0 0 unless $_is_MSWin32
976 0 0 if ($_all{$_id} eq "PDL")
980 0 0 if (@_ == 1) { }
0 0 elsif (@_ == 2 and $_[0] =~ /^:,(\d+):(\d+)/ and ref $_[1]) { }
0 0 elsif (not ref $_[0] and $_[0] =~ /^(\d+)$/) { }
0 0 elsif (@_ == 2) { }
0 0 elsif (@_ > 2) { }
1023 0 0 if (exists $_ob3{"${_id}:deeply"})
1033 0 0 if $@
1042 0 0 if $_len
1049 0 0 chop $_key ? :
1050 0 0 $_len ? :
1052 0 0 if $@
1054 0 0 unless defined $_buf
1057 0 0 &blessed($_buf) && $_buf->can('SHARED_ID') && $_ob2{$_buf->[0]} ? :
1091 0 0 if $@
1099 0 0 if $INC{'MCE/Shared/Queue.pm'}
1103 0 0 if $INC{'MCE/Shared/Handle.pm'}
1107 0 0 if $INC{'MCE/Shared/Condvar.pm'}
1113 0 0 if ($_is_MSWin32) { }
1126 0 0 unless ($_nbytes = unpack("L", $_val_bytes))
1127 0 0 if ($_count) { }
1129 0 0 if ++$_count % 50 == 0 and &MCE::Shared::Server::time() - $_start > "0.03"
1138 0 0 unless length $_func == 8
1149 0 0 unless length $_func == 6
1172 0 46 $^O eq 'solaris' ? :
0 46 $INC{'POSIX.pm'} ? :
1190 7 0 unless ($_[0][4])
1193 0 7 unless eval " eval { require $c }; $c->can('TIEARRAY') "
1200 9 0 unless ($_[0][4])
1203 0 9 unless eval " eval { require $c }; $c->can('TIEHASH') "
1210 0 0 unless ($_[0][4])
1213 0 0 unless eval " eval { require $c }; $c->can('TIESCALAR') "
1237 0 0 if $INC{'threads.pm'}
1238 0 0 if $_tid
1244 3 113 if $_stopped
1245 0 113 unless $_is_client and defined $_svr_pid and defined $_[0]
1247 58 55 if ($_spawn_child and $_init_pid and $_init_pid eq "$$.$_tid")
1249 0 58 if not $_svr_pid or waitpid $_svr_pid, 1
1254 48 65 if (exists $_new{$_id})
1255 0 48 $_tid ? :
1257 48 0 if ($_new{$_id} eq $_pid)
1258 0 48 if $MCE::Signal::KILLED
1284 17 76 if $INC{'MCE/Shared/Condvar.pm'}
1289 4 89 if $INC{'MCE/Shared/Handle.pm'}
1294 22 71 if $INC{'MCE/Shared/Queue.pm'}
1305 0 2025 $_tid ? :
1306 0 2025 if $_is_MSWin32
1308 2025 0 unless $_DAT_LOCK->{$_pid}
1311 0 2025 $_tid ? :
1313 2025 0 if $_DAT_LOCK->{$_pid}
1331 0 31 if defined $\
1332 0 31 if $/ ne $LF
1339 0 31 $_is_MSWin32 ? :
1344 31 0 unless $_is_MSWin32
1347 0 31 if $MCE::Signal::SIG
1353 0 31 unless defined $_SVR
1356 0 31 unless $_id =~ /\d+/
1376 382 534 wantarray ? :
317 916 !defined(wantarray) ? :
1378 0 1233 if defined $\
1385 0 1233 $_is_MSWin32 ? :
1387 155 1078 if (@_ == 2) { }
1398 916 317 if ($_wa)
1399 0 916 if $/ ne $LF
1404 1233 0 unless $_is_MSWin32
1407 0 1233 if $MCE::Signal::SIG
1409 317 916 unless $_wa
1410 534 382 $_wa != 1 ? :
1416 58 0 if ($_spawn_child and $_init_pid and $_init_pid eq "$$.$_tid")
1418 0 58 if not $_svr_pid or waitpid $_svr_pid, 1
1421 0 58 if defined $\
1422 0 58 if $/ ne $LF
1429 0 58 $_is_MSWin32 ? :
1437 0 58 if $_le1
1438 43 15 if $_le2
1440 58 0 unless $_is_MSWin32
1443 0 58 if $MCE::Signal::SIG
1452 0 85 unless defined $_DAU_W_SOCK
1454 0 85 if defined $\
1455 0 85 if $/ ne $LF
1462 0 85 $_is_MSWin32 ? :
1468 85 0 unless $_is_MSWin32
1471 0 85 if $MCE::Signal::SIG
1479 0 224 if defined $\
1484 0 224 $_is_MSWin32 ? :
1489 224 0 unless $_is_MSWin32
1492 0 224 if $MCE::Signal::SIG
1502 0 40 if defined $\
1503 0 40 if $/ ne $LF
1506 0 40 if defined $self->[5]
1510 0 40 $_is_MSWin32 ? :
1515 40 0 unless $_is_MSWin32
1518 0 40 if $MCE::Signal::SIG
1526 0 157 if defined $\
1527 0 157 if $/ ne $LF
1532 104 53 if (@_ == 3)
1533 0 104 ref $_[2] ? :
1538 0 157 $_is_MSWin32 ? :
1544 156 1 if $_len >= 0
1546 157 0 unless $_is_MSWin32
1549 0 157 if $MCE::Signal::SIG
1551 1 156 if $_len < 0
1553 0 156 if ($_[1][3] and $_[0] eq "FETCH")
1564 0 4 if defined $\
1565 0 4 if $/ ne $LF
1572 0 4 $_is_MSWin32 ? :
1578 4 0 unless $_is_MSWin32
1581 0 4 if $MCE::Signal::SIG
1583 4 0 length $_size ? :
1614 0 0 if @_ == 2 and ref $_[1] eq 'CODE' || !$_[1]
1622 0 0 if @_ == 2 and ref $_[1] eq 'CODE' || !$_[1]
1631 0 0 ref $_[1] eq 'HASH' && $_[1]{'unbless'} ? :
1632 0 0 defined wantarray ? :
1633 0 0 $_tid ? :
1637 0 0 if (defined $_svr_pid and exists $_new{$_id} and $_new{$_id} eq $_pid)
1652 0 0 ref $_[0] eq 'HASH' ? :
1655 0 0 if exists $_lkup->{$_id}
1657 0 0 @_ ? :
1665 0 0 if defined $\
1666 0 0 if $/ ne $LF
1673 0 0 $_is_MSWin32 ? :
1679 0 0 if $_len >= 0
1681 0 0 unless $_is_MSWin32
1684 0 0 if $MCE::Signal::SIG
1686 0 0 if $_len < 0
1695 0 0 if ($_class->isa('MCE::Shared::Array') or $_class->isa('Tie::StdArray')) { }
0 0 elsif ($_class->isa('MCE::Shared::Hash') or $_class->isa('Tie::StdHash')) { }
0 0 elsif ($_class->isa('MCE::Shared::Scalar') or $_class->isa('Tie::StdScalar')) { }
1696 0 0 if &$_blessed($_) and $_->can("export")
1699 0 0 if $_lkup->{'unbless'}
1702 0 0 if &$_blessed($_) and $_->can("export")
1705 0 0 if $_lkup->{'unbless'}
1708 0 0 if (&$_blessed(${$_item;}) and ${$_item;}->can("export"))
1711 0 0 if $_lkup->{'unbless'}
1714 0 0 if ($_class->isa('MCE::Shared::Ordhash')) { }
0 0 elsif ($_class->isa('MCE::Shared::Cache')) { }
0 0 elsif ($_class->isa('Hash::Ordered')) { }
0 0 elsif ($_class->isa('Tie::ExtraHash')) { }
0 0 elsif ($_class->isa('Tie::IxHash')) { }
1720 0 0 if (&reftype($_data) eq 'ARRAY') { }
0 0 elsif (&reftype($_data) eq 'HASH') { }
1721 0 0 if &$_blessed($_) and $_->can("export")
1725 0 0 if &$_blessed($_) and $_->can("export")
1742 2 0 $pkg->can('NEXTKEY') || $pkg->can('keys') ? :
1743 0 0 $pkg->can('get') ? :
2 0 $pkg->can('FETCH') ? :
1745 0 2 unless ($flg || $pkg->can('FETCHSIZE') and $get)
1752 2 0 if $pkg->isa("MCE::Shared::Cache")
1754 2 0 if (not @keys) { }
0 0 elsif (@keys == 1 and $keys[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
0 0 elsif ($pkg->isa('MCE::Shared::Cache')) { }
1758 0 0 unless $pkg->isa("MCE::Shared::Base::Common")
1766 2 8 unless @keys
1789 0 127 if defined $\
1790 0 127 if $/ ne $LF
1797 0 127 $_is_MSWin32 ? :
1803 112 15 if $_len >= 0
1805 127 0 unless $_is_MSWin32
1808 0 127 if $MCE::Signal::SIG
1810 15 112 if $_len < 0
1812 1 6 wantarray ? :
7 105 unless @{$_b = &$_thaw($_buf);}
1814 0 105 if ($_[0][3])
1819 12 12 @{$_b;} == 2 ? :
24 81 wantarray ? :
1833 0 0 if (@_)
1848 0 34 @_ > 1 ? :
1851 0 59 @_ > 2 ? :
1863 0 58 if (@_ > 1 and $_[0][2]) { }
0 58 elsif (@_ == 2 and &$_blessed($_[1]) and $_[1]->can('SHARED_ID')) { }
4 54 elsif (ref $_[2]) { }
1864 0 0 if ref $_[-1]
1871 0 4 if (&$_blessed($_[2]) and $_[2]->can('SHARED_ID')) { }
2 2 elsif ($_[0][1]->isa('MCE::Shared::Array') or $_[0][1]->isa('MCE::Shared::Hash')) { }
1885 0 54 if (ref $_[2])
1886 0 0 if (&$_blessed($_[2]) and $_[2]->can("SHARED_ID"))
1895 0 145 @_ == 1 && !wantarray ? :
1900 0 12 unless $self->[6]
1909 0 4 unless $self->[6]