File-NFSLock
view release on metacpan or search on metacpan
t/240_fork_ex.t view on Meta::CPAN
} elsif (!$pid) {
# Child process
# Test possible race condition
# by making parent reach newpid()
# and attempt relock before child
# even calls newpid() the first time.
sleep 2;
$lock1->newpid;
# Act busy for a while
sleep 5;
# Now release lock
exit;
} else {
# Fork worked
ok 1;
# Both parent and child must unlock
# before the lock is truly released.
$lock1->newpid;
t/242_fork_ex.t view on Meta::CPAN
};
ok ($lock1);
my $pid = $lock1->fork;
if (!defined $pid) {
die "fork failed!";
} elsif (!$pid) {
# Child process
# Act busy for a while
sleep 5;
# Now release lock
exit;
} else {
# Fork worked
ok 1;
# Leaving scope should release only the parent side
}
t/250_fork_sh.t view on Meta::CPAN
} elsif (!$pid) {
# Child process
# Test possible race condition
# by making parent reach newpid()
# and attempt relock before child
# even calls newpid() the first time.
sleep 2;
$lock1->newpid;
# Act busy for a while
sleep 5;
# Now release lock
exit;
} else {
# Fork worked
ok 1;
# Both parent and child must unlock
# before the lock is truly released.
$lock1->newpid;
t/252_fork_sh.t view on Meta::CPAN
};
ok ($lock1);
my $pid = $lock1->fork;
if (!defined $pid) {
die "fork failed!";
} elsif (!$pid) {
# Child process
# Act busy for a while
sleep 5;
# Now release lock
exit;
} else {
# Fork worked
ok 1;
# Leaving scope should release only the parent side
}
( run in 1.587 second using v1.01-cache-2.11-cpan-87723dcf8b7 )