public static function obtainReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->createFile(self::READ_LOCK_FILE);
        if (!$lock->lock(LOCK_SH)) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Can\'t obtain shared reading index lock');
        }
        return $lock;
    }
public static function obtainReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->createFile(self::READ_LOCK_FILE);
        if (!$lock->lock(LOCK_SH)) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Can\'t obtain shared reading index lock');
        }
        return $lock;
    }
public static function obtainReadLock ( Zend_Search_Lucene_Storage_Directory $ lockDirectory ) { $ lock = $ lockDirectory -> createFile ( self :: READ_LOCK_FILE ) ; if ( ! $ lock -> lock ( LOCK_SH ) ) { include_once 'Zend/Search/Lucene/Exception.php' ; throw new Zend_Search_Lucene_Exception ( 'Can\'t obtain shared reading index lock' ) ; } return $ lock ; }
Obtain shared read lock on the index

It doesn't block other read or update processes, but prevent index from the premature cleaning-up

@param  Zend_Search_Lucene_Storage_Directory $defaultLockDirectory
@return Zend_Search_Lucene_Storage_File
@throws Zend_Search_Lucene_Exception
Obtain shared read lock on the index