27 Oct 2007 19:46:10 UTC
- Development release
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (21 / 5 / 2)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (460.82KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCREAMYG Marvin Humphreyand 1 contributors
- Marvin Humphrey <marvin at rectangular dot com>
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).
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.