刘刊 > pantheon-0.58 > Vulcan::ProcLock

Download:
pantheon-0.58.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Vulcan::ProcLock - Advisory lock using a regular file

SYNOPSIS ^

 use Vulcan::ProcLock;

 my $lock = Vulcan::ProcLock->new( '/lock/file' );

 $lock->lock();

 if ( my $pid = Vulcan::ProcLock->check( '/lock/file' ) )
 {
     print "Locked by $pid.\n";
 }

METHODS ^

check( $file )

Returns PID of owner, undef if not locked.

lock()

Attempts to acquire lock. Returns pid if successful, undef otherwise.

handle()

Returns file handle of object.

read()

Returns a running pid or undef.

syntax highlighting: