File-Lock-ParentLock

 view release on metacpan or  search on metacpan

lib/File/Lock/ParentLock.pm  view on Meta::CPAN

	}
	chomp $oldpid;
	if ($oldpid<=0) {
	    warn "$lockfile: invalid pid value $oldpid";
	    return PERMITTED_NOT_LOCKED_INVALID_LOCK_FILE;
	}

	return PERMITTED_LOCKED_BY_US if ($oldpid==$pid);

	if ($pidmap{$oldpid}) {
	    # old pid still alive;
	    my $intermedpid=$pid;
	    my $counter=0;
	    my $counter_threshhold=70000;
	    while ($intermedpid and $counter++ <$counter_threshhold) {
		if ($intermedpid==$oldpid) {
		    return PERMITTED_LOCKED_BY_PARENT;
		}
		$intermedpid=$parentmap{$intermedpid};
	    }
	    die "threshhold reached for $oldpid" if $counter >=$counter_threshhold;



( run in 2.501 seconds using v1.01-cache-2.11-cpan-14f38c9f855 )