Branch Coverage

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


line true false branch
37 43 0 if not $INC{'IO/FDPass.pm'} and $^O ne "cygwin"
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 if $^O ne "aix" and $^O ne "linux"
385 0 43 if ($_is_MSWin32) { }
399 43 0 unless $_is_MSWin32
401 43 0 if ($_spawn_child) { }
403 0 43 if defined $_svr_pid and $_svr_pid == 0
407 0 0 if defined $_svr_pid
410 0 43 unless defined $_svr_pid
413 0 43 if not $_spawn_child or $_is_MSWin32
420 0 15 unless $_is_client and $_init_pid and $_init_pid eq "$$.$_tid"
422 0 15 if $INC{'MCE/Child.pm'}
423 3 12 if $INC{'MCE/Hobo.pm'}
427 15 0 if (defined $_svr_pid)
430 0 15 if (ref $_svr_pid) { }
440 0 15 if defined $\
445 15 14 if waitpid $_svr_pid, 1
446 0 14 if (&MCE::Shared::Server::time() - $_start > "0.7")
471 0 0 ref $_svr_pid ? :
478 0 0 if exists $_ob3{"${_id}:count"} and --$_ob3{"${_id}:count"} > 0
481 0 0 if exists $_lkup->{$_id}
485 0 0 if (exists $_ob3{"${_id}:deeply"}) { }
0 0 elsif (exists $_obj{$_id}) { }
492 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') { }
495 0 0 if (&blessed(scalar $_item->FETCH))
508 0 0 if defined fileno $_obj{$_id}
512 0 0 if exists $_obj{$_id}
513 0 0 if exists $_itr{$_id}
528 0 0 unless $_tid
534 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') { }
540 0 0 if defined fileno $_obj{$_id}
549 0 0 if exists $_export_nul{$_all{$_id}}
554 0 0 if (not $_spawn_child and $_is_MSWin32 || $INC{'Tk.pm'} || $INC{'Wx.pm'})
558 0 0 if not $_spawn_child or $_is_MSWin32
560 0 0 unless $_is_MSWin32
567 0 0 if $MCE::MCE and $MCE::MCE->{'_wid'} == 0
573 0 0 if $_init_pid eq $_oid
576 0 0 if $_spawn_child and not $_is_MSWin32
578 0 0 if $_init_pid eq $_oid and not $_is_MSWin32
579 0 0 if $_init_pid eq $_oid and not $_spawn_child
582 0 0 if (not defined $^S or $^S)
583 0 0 if ($INC{'threads.pm'} and 'threads'->tid != 0 or $ENV{'PERL_IPERL_RUNNING'} or $_running_inside_eval) { }
589 0 0 if $_t =~ /^(?:[^\n]+\n){1,7}\teval / or $_t =~ /\n\teval [^\n]+\n\t(?:eval|Try)/
600 0 0 defined $_[0] ? :
602 0 0 $_spawn_child && !$_is_MSWin32 ? :
615 0 0 if ($_wa == 1)
630 0 0 if $_obj->isa("Tie::StdHash")
631 0 0 unless $_obj->can("FIRSTKEY")
633 0 0 if (wantarray) { }
0 0 elsif ($_obj->isa('Tie::ExtraHash')) { }
0 0 elsif ($_obj->isa('Tie::IxHash')) { }
635 0 0 if (defined $_key)
651 0 0 if (defined $_key)
660 0 0 wantarray ? :
664 0 0 unless (exists $_itr{$_id})
667 0 0 $pkg->can('NEXTKEY') || $pkg->can('keys') ? :
668 0 0 $pkg->can('get') ? :
0 0 $pkg->can('FETCH') ? :
670 0 0 unless ($flg || $pkg->can('FETCHSIZE') and $get)
678 0 0 if $pkg->isa("MCE::Shared::Cache")
680 0 0 if (not exists $_itr{"${_id}:args"}) { }
683 0 0 $pkg->can('keys') ? :
687 0 0 if (@{$_args;} == 1 and $_args->[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
690 0 0 if $pkg->isa("MCE::Shared::Base::Common")
694 0 0 if $pkg->isa("MCE::Shared::Cache")
701 0 0 unless defined $_key
713 0 0 if ($_wa)
739 0 0 if ($_len)
743 0 0 if (exists $_args->[0]{$_k})
746 0 0 unless $_fd >= 0
749 0 0 unless open $_args->[0]{$_k}, "+<&=$_fd"
757 0 0 unless ($_item = _share($_params, @{$_args;}))
767 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') { }
770 0 0 if $INC{'MCE/Shared/Queue.pm'}
775 0 0 if $INC{'MCE/Shared/Handle.pm'}
780 0 0 if $INC{'MCE/Shared/Condvar.pm'}
788 0 0 if $_channel_id >= $_SVR->{'_data_channels'}
822 0 0 $_wa ? :
824 0 0 if $@
847 0 0 if ($_wa == 1) { }
0 0 elsif ($_wa) { }
861 0 0 if $@
874 0 0 exists $_all{$_id} ? :
875 0 0 if $_ret
887 0 0 if $_len
889 0 0 if (exists $_obj{$_id}) { }
893 0 0 if (exists $_export_nul{$_all{$_id}})
899 0 0 if ($_obj{$_id}->can('clone')) { }
902 0 0 $_len ? :
924 0 0 if (my $_code = $_var->can('next')) { }
943 0 0 if (my $_code = $_var->can('rewind')) { }
947 0 0 if exists $_itr{$_id}
949 0 0 if (@_args) { }
962 0 0 unless $_is_MSWin32
975 0 0 if ($_all{$_id} eq "PDL")
979 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) { }
1022 0 0 if (exists $_ob3{"${_id}:deeply"})
1032 0 0 if $@
1041 0 0 if $_len
1048 0 0 chop $_key ? :
1049 0 0 $_len ? :
1051 0 0 if $@
1053 0 0 unless defined $_buf
1056 0 0 &blessed($_buf) && $_buf->can('SHARED_ID') && $_ob2{$_buf->[0]} ? :
1090 0 0 if $@
1098 0 0 if $INC{'MCE/Shared/Queue.pm'}
1102 0 0 if $INC{'MCE/Shared/Handle.pm'}
1106 0 0 if $INC{'MCE/Shared/Condvar.pm'}
1112 0 0 if ($_is_MSWin32) { }
1125 0 0 unless ($_nbytes = unpack("L", $_val_bytes))
1126 0 0 if ($_count) { }
1128 0 0 if ++$_count % 50 == 0 and &MCE::Shared::Server::time() - $_start > "0.03"
1137 0 0 unless length $_func == 8
1148 0 0 unless length $_func == 6
1171 0 43 $^O eq 'solaris' ? :
0 43 $INC{'POSIX.pm'} ? :
1189 7 0 unless ($_[0][4])
1192 0 7 unless eval " eval { require $c }; $c->can('TIEARRAY') "
1199 9 0 unless ($_[0][4])
1202 0 9 unless eval " eval { require $c }; $c->can('TIEHASH') "
1209 0 0 unless ($_[0][4])
1212 0 0 unless eval " eval { require $c }; $c->can('TIESCALAR') "
1236 0 0 if $INC{'threads.pm'}
1237 0 0 if $_tid
1243 3 110 if $_stopped
1244 0 110 unless $_is_client and defined $_svr_pid and defined $_[0]
1246 58 52 if ($_spawn_child and $_init_pid and $_init_pid eq "$$.$_tid")
1248 0 58 if not $_svr_pid or waitpid $_svr_pid, 1
1253 48 62 if (exists $_new{$_id})
1254 0 48 $_tid ? :
1256 48 0 if ($_new{$_id} eq $_pid)
1257 0 48 if $MCE::Signal::KILLED
1283 8 76 if $INC{'MCE/Shared/Condvar.pm'}
1288 4 80 if $INC{'MCE/Shared/Handle.pm'}
1293 22 62 if $INC{'MCE/Shared/Queue.pm'}
1304 0 2005 $_tid ? :
1306 2005 0 unless $_DAT_LOCK->{$_pid}
1309 0 2005 $_tid ? :
1311 2005 0 if $_DAT_LOCK->{$_pid}
1329 0 28 if defined $\
1330 0 28 if $/ ne $LF
1337 0 28 $_is_MSWin32 ? :
1342 28 0 unless $_is_MSWin32
1345 0 28 if $MCE::Signal::SIG
1351 0 28 unless defined $_SVR
1354 0 28 unless $_id =~ /\d+/
1374 382 534 wantarray ? :
312 916 !defined(wantarray) ? :
1376 0 1228 if defined $\
1383 0 1228 $_is_MSWin32 ? :
1385 155 1073 if (@_ == 2) { }
1396 916 312 if ($_wa)
1397 0 916 if $/ ne $LF
1402 1228 0 unless $_is_MSWin32
1405 0 1228 if $MCE::Signal::SIG
1407 312 916 unless $_wa
1408 534 382 $_wa != 1 ? :
1414 49 0 if ($_spawn_child and $_init_pid and $_init_pid eq "$$.$_tid")
1416 0 49 if not $_svr_pid or waitpid $_svr_pid, 1
1419 0 49 if defined $\
1420 0 49 if $/ ne $LF
1427 0 49 $_is_MSWin32 ? :
1435 0 49 if $_le1
1436 34 15 if $_le2
1438 49 0 unless $_is_MSWin32
1441 0 49 if $MCE::Signal::SIG
1450 0 78 unless defined $_DAU_W_SOCK
1452 0 78 if defined $\
1453 0 78 if $/ ne $LF
1460 0 78 $_is_MSWin32 ? :
1466 78 0 unless $_is_MSWin32
1469 0 78 if $MCE::Signal::SIG
1477 0 224 if defined $\
1482 0 224 $_is_MSWin32 ? :
1487 224 0 unless $_is_MSWin32
1490 0 224 if $MCE::Signal::SIG
1500 0 40 if defined $\
1501 0 40 if $/ ne $LF
1504 0 40 if defined $self->[5]
1508 0 40 $_is_MSWin32 ? :
1513 40 0 unless $_is_MSWin32
1516 0 40 if $MCE::Signal::SIG
1524 0 157 if defined $\
1525 0 157 if $/ ne $LF
1530 104 53 if (@_ == 3)
1531 0 104 ref $_[2] ? :
1536 0 157 $_is_MSWin32 ? :
1542 156 1 if $_len >= 0
1544 157 0 unless $_is_MSWin32
1547 0 157 if $MCE::Signal::SIG
1549 1 156 if $_len < 0
1551 0 156 if ($_[1][3] and $_[0] eq "FETCH")
1562 0 4 if defined $\
1563 0 4 if $/ ne $LF
1570 0 4 $_is_MSWin32 ? :
1576 4 0 unless $_is_MSWin32
1579 0 4 if $MCE::Signal::SIG
1581 4 0 length $_size ? :
1612 0 0 if @_ == 2 and ref $_[1] eq 'CODE' || !$_[1]
1620 0 0 if @_ == 2 and ref $_[1] eq 'CODE' || !$_[1]
1629 0 0 ref $_[1] eq 'HASH' && $_[1]{'unbless'} ? :
1630 0 0 defined wantarray ? :
1631 0 0 $_tid ? :
1635 0 0 if (defined $_svr_pid and exists $_new{$_id} and $_new{$_id} eq $_pid)
1650 0 0 ref $_[0] eq 'HASH' ? :
1653 0 0 if exists $_lkup->{$_id}
1655 0 0 @_ ? :
1663 0 0 if defined $\
1664 0 0 if $/ ne $LF
1671 0 0 $_is_MSWin32 ? :
1677 0 0 if $_len >= 0
1679 0 0 unless $_is_MSWin32
1682 0 0 if $MCE::Signal::SIG
1684 0 0 if $_len < 0
1693 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')) { }
1694 0 0 if &$_blessed($_) and $_->can("export")
1697 0 0 if $_lkup->{'unbless'}
1700 0 0 if &$_blessed($_) and $_->can("export")
1703 0 0 if $_lkup->{'unbless'}
1706 0 0 if (&$_blessed(${$_item;}) and ${$_item;}->can("export"))
1709 0 0 if $_lkup->{'unbless'}
1712 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')) { }
1718 0 0 if (&reftype($_data) eq 'ARRAY') { }
0 0 elsif (&reftype($_data) eq 'HASH') { }
1719 0 0 if &$_blessed($_) and $_->can("export")
1723 0 0 if &$_blessed($_) and $_->can("export")
1740 2 0 $pkg->can('NEXTKEY') || $pkg->can('keys') ? :
1741 0 0 $pkg->can('get') ? :
2 0 $pkg->can('FETCH') ? :
1743 0 2 unless ($flg || $pkg->can('FETCHSIZE') and $get)
1750 2 0 if $pkg->isa("MCE::Shared::Cache")
1752 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')) { }
1756 0 0 unless $pkg->isa("MCE::Shared::Base::Common")
1764 2 8 unless @keys
1787 0 127 if defined $\
1788 0 127 if $/ ne $LF
1795 0 127 $_is_MSWin32 ? :
1801 112 15 if $_len >= 0
1803 127 0 unless $_is_MSWin32
1806 0 127 if $MCE::Signal::SIG
1808 15 112 if $_len < 0
1810 1 6 wantarray ? :
7 105 unless @{$_b = &$_thaw($_buf);}
1812 0 105 if ($_[0][3])
1817 12 12 @{$_b;} == 2 ? :
24 81 wantarray ? :
1831 0 0 if (@_)
1846 0 34 @_ > 1 ? :
1849 0 59 @_ > 2 ? :
1861 0 58 if (@_ > 1 and $_[0][2]) { }
0 58 elsif (@_ == 2 and &$_blessed($_[1]) and $_[1]->can('SHARED_ID')) { }
4 54 elsif (ref $_[2]) { }
1862 0 0 if ref $_[-1]
1869 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')) { }
1883 0 45 if (ref $_[2])
1884 0 0 if (&$_blessed($_[2]) and $_[2]->can("SHARED_ID"))
1893 0 145 @_ == 1 && !wantarray ? :
1898 0 6 unless $self->[6]
1907 0 1 unless $self->[6]