public static function obtainOptimizationLock(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->createFile(self::OPTIMIZATION_LOCK_FILE);
        if (!$lock->lock(LOCK_EX, true)) {
            return false;
        }
        return $lock;
    }
public static function obtainOptimizationLock(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->createFile(self::OPTIMIZATION_LOCK_FILE);
        if (!$lock->lock(LOCK_EX, true)) {
            return false;
        }
        return $lock;
    }
public static function obtainOptimizationLock ( Zend_Search_Lucene_Storage_Directory $ lockDirectory ) { $ lock = $ lockDirectory -> createFile ( self :: OPTIMIZATION_LOCK_FILE ) ; if ( ! $ lock -> lock ( LOCK_EX , true ) ) { return false ; } return $ lock ; }
Obtain exclusive optimization lock on the index

Returns lock object on success and false otherwise (doesn't block execution)

@param  Zend_Search_Lucene_Storage_Directory $lockDirectory
@return mixed
Obtain exclusive optimization lock on the index