KinoSearch::Store::SharedLock - Shared (read) lock.
my $lock_factory = KinoSearch::Store::LockFactory->new( folder => $folder, agent_id => $hostname, ); my $lock = $lock_factory->make_shared_lock( lock_name => 'segments_6r', timeout => 5000, );
SharedLock's interface is nearly identical to that of its parent class KinoSearch::Store::Lock, taking the same constructor arguments and implementing the same list of methods. It differs from Lock only in the semantics of two methods:
obtain() will not fail if another lock is held against lock_name (though it might fail for other reasons).
lock_name
is_locked() returns true so long as some lock, somewhere is holding a lock on the resource identified by lock_name. That lock could be this instance, or it could be another. So this sequence is entirely possible:
$lock->release; # works this time $lock->release; # doesn't do anything print "Still locked!" if $lock->is_locked; # prints "Still locked!"
Copyright 2007 Marvin Humphrey
See KinoSearch version 0.20.
To install KinoSearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm KinoSearch
CPAN shell
perl -MCPAN -e shell install KinoSearch
For more information on module installation, please visit the detailed CPAN module installation guide.