NAME

LCFG::Lock - Perl routines to lock/unlock component semaphore

VERSION

This documentation refers to LCFG::Lock version 1.17.1

SYNOPSIS

use LCFG::Lock

LCFG::Lock::Lock( component , options ... );
LCFG::Lock::Unlock( component , options ... );
LCFG::Lock::LockDir( [directory] );

DESCRIPTION

Lock and Unlock are used by LCFG components to prevent multiple simultaneous executions of component methods. They return 'ok' on sucess or undef on error. LockDir sets and/or returns the directory used for lockfiles.

OPTIONS

BREAK => 1

When used with Unlock, this option forces the lock on the named component to be broken, even if it was owned by some other process.

DEBUG => 1

Print debugging messages to stderr.

NOBLOCK => 1

Lock operations return immediately with exit value 'busy' if the semaphore is busy rather than waiting.

PID => pid

Use pid as the process owning the semaphore. The default is the parent process.

POLLTIME => secs

The time betwen polls when waiting for a lock to be released. Default is 1 sec.

QUIET => 1

Quiet mode. exit silently when attempting to release non-existent locks, or to take already existing locks.

TIMEOUT => secs

Lock operations return after secs seconds with exit value 'busy' if the semaphore is still busy.

VERBOSE => 1

Print messages when waiting for lock.

PLATFORMS

ScientificLinux6, EnterpriseLinux7, MacOSX

AUTHOR

Paul Anderson <dcspaul@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

Copyright (c) 2008-2014 University of Edinburgh

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Public License (version 2 or later).