Test::AutoBuild::Lock - Manage a lock file to prevent concurrent execution
use Test::AutoBuild::Lock
This module takes out an exclusive lock on a file, preventing multiple instances of the builder running concurrently against the same build home. The scheme to use for locking the file, can be one of flock, fcntl, or file. fcntl is preferred since it works across NFS. If this isn't supported on the OS running the builder, then flock should be used. As a last resort the file method should be used, with does a simple file presence/creation check, although if the builder fails in a bad way it is possible the lock will not be cleaned up correctly.
flock
fcntl
file
Creates a new lock manager, for the file specified by the file parameter. This should be a fully qualified path for the file to be locked. The file does not have to exist beforehand, but the path must be writable by the user running the build instance. The method parameter should be one of the strings 'fcntl', 'flock' or 'file' designating the method used to acquire the lock.
method
Attempt to acquire the lock, returning a true value if successfull, otherwise a false value to indicate failure (due to the lock being held by another process).
Release a lock previously acquired by the lock method. If a lock is not explicitly released, it will be unlocked during garbage collection (via a DESTROY method hook on this object).
lock
Daniel Berrange <dan@berrange.com> Dennis Gregorovic <dgregorovic@alum.mit.edu>
Copyright (C) 2004 Red Hat, Inc. Copyright (C) 2005 Daniel Berrange.
perl(1), fcntl(2), flock(2), Test::AutoBuild
perl(1)
fcntl(2)
flock(2)
To install Test::AutoBuild, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::AutoBuild
CPAN shell
perl -MCPAN -e shell install Test::AutoBuild
For more information on module installation, please visit the detailed CPAN module installation guide.