Branch Coverage

blib/lib/MCE/Shared/Server.pm
Criterion Covered Total %
branch 190 672 28.2


line true false branch
37 43 0 unless $INC{'IO/FDPass.pm'} or $^O =~ /cygwin|android/
39 0 43 $INC{'threads.pm'} ? :
41 43 0 unless ($INC{'PDL.pm'})
43 43 0 unless ($@)
46 43 0 if ($_encoder_ver - $_decoder_ver == 0)
53 0 43 if (not defined $_freeze)
76 0 43 $^O eq 'solaris' ? :
0 43 $INC{'POSIX.pm'} ? :
133 0 0 if $INC{'threads.pm'}
137 0 0 if $_is_MSWin32 and $MCE::Signal::KILLED
139 15 28 if $_init_pid and $_init_pid eq "$$.$_tid" and $_is_client
147 31 127 unless ($_svr_pid)
151 0 31 if $_has_fh and not $INC{'IO/FDPass.pm'}
156 29 129 if ($_has_fh)
159 0 29 unless $INC{'IO/FDPass.pm'}
164 84 119 if (defined $_[1]{$_k})
187 0 158 if defined $\
188 0 158 if $/ ne $LF
190 0 158 $_is_MSWin32 ? :
193 29 129 keys %_hndls ? :
200 29 129 if (keys %_hndls)
202 55 61 if (exists $_hndls{$_k})
212 158 0 if $_len
214 158 0 unless $_is_MSWin32
216 0 158 unless $_len
218 29 129 if (keys %_hndls)
223 156 2 unless ($_deeply)
225 0 156 $_tid ? :
232 0 0 unless $_svr_pid
239 0 0 if defined $\
240 0 0 if $/ ne $LF
245 0 0 $_is_MSWin32 ? :
251 0 0 unless $_is_MSWin32
254 0 0 if $MCE::Signal::SIG
264 0 0 if ($_class eq ':construct_module:') { }
0 0 elsif ($_class eq ':construct_pdl:') { }
266 0 0 @{$_item;} ? :
271 0 0 unless MCE::Shared::_use($_class = $_module)
273 0 0 unless eval " $_module->can('${_fcn}') "
276 0 0 unless $_item = $_module->$_fcn(@{$_item;})
278 0 0 if $_class->isa("Graphics::Framebuffer")
279 0 0 if $_fcn eq "TIEHANDLE"
281 0 0 if $_has_args and $_fcn eq "TIEHANDLE" and not defined fileno $_item
322 0 0 if ($_class eq 'MCE::Shared::Handle' and &reftype($_item) eq 'ARRAY') { }
331 0 0 if (&reftype($_obj{$_id}) eq "HASH" and &reftype($_obj{$_id}{'fh'}) eq "GLOB")
334 0 0 if ($_class->isa("Tie::File"))
348 0 0 if ($_params->{'tied'})
351 0 0 if $_class->isa($_module)
353 0 0 if $self->[2]
360 48 43 if $_svr_pid
362 0 43 if ($INC{'PDL.pm'})
364 0 0 unless $INC{'PDL/IO/Storable.pm'}
373 43 0 $_init_pid eq $_oid ? :
382 0 43 unless ($^O =~ /linux|android|aix/)
386 0 43 if ($_is_MSWin32) { }
400 43 0 unless $_is_MSWin32
402 43 0 if ($_spawn_child) { }
404 0 43 if defined $_svr_pid and $_svr_pid == 0
408 0 0 if defined $_svr_pid
411 0 43 unless defined $_svr_pid
414 0 43 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::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 43 $^O eq 'solaris' ? :
0 43 $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 110 if $_stopped
1245 0 110 unless $_is_client and defined $_svr_pid and defined $_[0]
1247 58 52 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 62 if (exists $_new{$_id})
1255 0 48 $_tid ? :
1257 48 0 if ($_new{$_id} eq $_pid)
1258 0 48 if $MCE::Signal::KILLED
1284 8 76 if $INC{'MCE/Shared/Condvar.pm'}
1289 4 80 if $INC{'MCE/Shared/Handle.pm'}
1294 22 62 if $INC{'MCE/Shared/Queue.pm'}
1305 0 2005 $_tid ? :
1307 2005 0 unless $_DAT_LOCK->{$_pid}
1310 0 2005 $_tid ? :
1312 2005 0 if $_DAT_LOCK->{$_pid}
1330 0 28 if defined $\
1331 0 28 if $/ ne $LF
1338 0 28 $_is_MSWin32 ? :
1343 28 0 unless $_is_MSWin32
1346 0 28 if $MCE::Signal::SIG
1352 0 28 unless defined $_SVR
1355 0 28 unless $_id =~ /\d+/
1375 382 534 wantarray ? :
312 916 !defined(wantarray) ? :
1377 0 1228 if defined $\
1384 0 1228 $_is_MSWin32 ? :
1386 155 1073 if (@_ == 2) { }
1397 916 312 if ($_wa)
1398 0 916 if $/ ne $LF
1403 1228 0 unless $_is_MSWin32
1406 0 1228 if $MCE::Signal::SIG
1408 312 916 unless $_wa
1409 534 382 $_wa != 1 ? :
1415 49 0 if ($_spawn_child and $_init_pid and $_init_pid eq "$$.$_tid")
1417 0 49 if not $_svr_pid or waitpid $_svr_pid, 1
1420 0 49 if defined $\
1421 0 49 if $/ ne $LF
1428 0 49 $_is_MSWin32 ? :
1436 0 49 if $_le1
1437 34 15 if $_le2
1439 49 0 unless $_is_MSWin32
1442 0 49 if $MCE::Signal::SIG
1451 0 78 unless defined $_DAU_W_SOCK
1453 0 78 if defined $\
1454 0 78 if $/ ne $LF
1461 0 78 $_is_MSWin32 ? :
1467 78 0 unless $_is_MSWin32
1470 0 78 if $MCE::Signal::SIG
1478 0 224 if defined $\
1483 0 224 $_is_MSWin32 ? :
1488 224 0 unless $_is_MSWin32
1491 0 224 if $MCE::Signal::SIG
1501 0 40 if defined $\
1502 0 40 if $/ ne $LF
1505 0 40 if defined $self->[5]
1509 0 40 $_is_MSWin32 ? :
1514 40 0 unless $_is_MSWin32
1517 0 40 if $MCE::Signal::SIG
1525 0 157 if defined $\
1526 0 157 if $/ ne $LF
1531 104 53 if (@_ == 3)
1532 0 104 ref $_[2] ? :
1537 0 157 $_is_MSWin32 ? :
1543 156 1 if $_len >= 0
1545 157 0 unless $_is_MSWin32
1548 0 157 if $MCE::Signal::SIG
1550 1 156 if $_len < 0
1552 0 156 if ($_[1][3] and $_[0] eq "FETCH")
1563 0 4 if defined $\
1564 0 4 if $/ ne $LF
1571 0 4 $_is_MSWin32 ? :
1577 4 0 unless $_is_MSWin32
1580 0 4 if $MCE::Signal::SIG
1582 4 0 length $_size ? :
1613 0 0 if @_ == 2 and ref $_[1] eq 'CODE' || !$_[1]
1621 0 0 if @_ == 2 and ref $_[1] eq 'CODE' || !$_[1]
1630 0 0 ref $_[1] eq 'HASH' && $_[1]{'unbless'} ? :
1631 0 0 defined wantarray ? :
1632 0 0 $_tid ? :
1636 0 0 if (defined $_svr_pid and exists $_new{$_id} and $_new{$_id} eq $_pid)
1651 0 0 ref $_[0] eq 'HASH' ? :
1654 0 0 if exists $_lkup->{$_id}
1656 0 0 @_ ? :
1664 0 0 if defined $\
1665 0 0 if $/ ne $LF
1672 0 0 $_is_MSWin32 ? :
1678 0 0 if $_len >= 0
1680 0 0 unless $_is_MSWin32
1683 0 0 if $MCE::Signal::SIG
1685 0 0 if $_len < 0
1694 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')) { }
1695 0 0 if &$_blessed($_) and $_->can("export")
1698 0 0 if $_lkup->{'unbless'}
1701 0 0 if &$_blessed($_) and $_->can("export")
1704 0 0 if $_lkup->{'unbless'}
1707 0 0 if (&$_blessed(${$_item;}) and ${$_item;}->can("export"))
1710 0 0 if $_lkup->{'unbless'}
1713 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')) { }
1719 0 0 if (&reftype($_data) eq 'ARRAY') { }
0 0 elsif (&reftype($_data) eq 'HASH') { }
1720 0 0 if &$_blessed($_) and $_->can("export")
1724 0 0 if &$_blessed($_) and $_->can("export")
1741 2 0 $pkg->can('NEXTKEY') || $pkg->can('keys') ? :
1742 0 0 $pkg->can('get') ? :
2 0 $pkg->can('FETCH') ? :
1744 0 2 unless ($flg || $pkg->can('FETCHSIZE') and $get)
1751 2 0 if $pkg->isa("MCE::Shared::Cache")
1753 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')) { }
1757 0 0 unless $pkg->isa("MCE::Shared::Common")
1765 2 8 unless @keys
1788 0 127 if defined $\
1789 0 127 if $/ ne $LF
1796 0 127 $_is_MSWin32 ? :
1802 112 15 if $_len >= 0
1804 127 0 unless $_is_MSWin32
1807 0 127 if $MCE::Signal::SIG
1809 15 112 if $_len < 0
1811 1 6 wantarray ? :
7 105 unless @{$_b = &$_thaw($_buf);}
1813 0 105 if ($_[0][3])
1818 12 12 @{$_b;} == 2 ? :
24 81 wantarray ? :
1832 0 0 if (@_)
1847 0 34 @_ > 1 ? :
1850 0 59 @_ > 2 ? :
1862 0 58 if (@_ > 1 and $_[0][2]) { }
0 58 elsif (@_ == 2 and &$_blessed($_[1]) and $_[1]->can('SHARED_ID')) { }
4 54 elsif (ref $_[2]) { }
1863 0 0 if ref $_[-1]
1870 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')) { }
1884 0 45 if (ref $_[2])
1885 0 0 if (&$_blessed($_[2]) and $_[2]->can("SHARED_ID"))
1894 0 145 @_ == 1 && !wantarray ? :
1899 0 6 unless $self->[6]
1908 0 1 unless $self->[6]