Release shared read lock

@param Zend_Search_Lucene_Storage_Directory $lockDirectory
325363
public static function releaseReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->getFileObject(self::READ_LOCK_FILE);
        $lock->unlock();
    }
1259282
public function setFileLock($file_lock)
    {
        if (empty($file_lock) && $file_lock !== false) {
            throw new PageCacheException(__CLASS__ . ' file lock can not be empty. To disable set to boolean false.');
        }
        $this->file_lock = $file_lock;
    }
1244094
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;
    }
539498
public static function getRubricBlocks(tao_models_classes_service_StorageDirectory $directory, $view) {
        
        $returnValue = array();
        
        $elements = self::getContentVariableElements($directory);
        
        foreach ($elements as $serial => $data) {
        
            if (isset($data['qtiClass']) && $data['qtiClass'] == 'rubricBlock') {
        
                if (!empty($data['attributes']) && is_array($data['attributes']['view']) && in_array($view, $data['attributes']['view'])) {
                        $returnValue[$serial] = $data;
                }
            }
        }
        
        return $returnValue;
    }
1127452
public function lock($uri, LockInfo $lockInfo)
    {
        // We're making the lock timeout 30 minutes
        $lockInfo->timeout = 30 * 60;
        $lockInfo->created = time();
        $lockInfo->uri = $uri;

        $locks = $this->getLocks($uri, false);
        $exists = false;
        foreach ($locks as $lock) {
            if ($lock->token == $lockInfo->token) {
                $exists = true;
            }
        }

        if ($exists) {
            $stmt = $this->pdo->prepare('UPDATE '.$this->tableName.' SET owner = ?, timeout = ?, scope = ?, depth = ?, uri = ?, created = ? WHERE token = ?');
            $stmt->execute([
                $lockInfo->owner,
                $lockInfo->timeout,
                $lockInfo->scope,
                $lockInfo->depth,
                $uri,
                $lockInfo->created,
                $lockInfo->token,
            ]);
        } else {
            $stmt = $this->pdo->prepare('INSERT INTO '.$this->tableName.' (owner,timeout,scope,depth,uri,created,token) VALUES (?,?,?,?,?,?,?)');
            $stmt->execute([
                $lockInfo->owner,
                $lockInfo->timeout,
                $lockInfo->scope,
                $lockInfo->depth,
                $uri,
                $lockInfo->created,
                $lockInfo->token,
            ]);
        }

        return true;
    }
282830
public static function loadLockPackages(array $lockData)
    {
        $loader = new ArrayLoader();
        $lockData = static::loadLockPackage($loader, $lockData);
        $lockData = static::loadLockPackage($loader, $lockData, true);
        $lockData = static::convertLockAlias($lockData);

        return $lockData;
    }
1115499
public function unlock($resource) {
        if ($this->hasExclusiveLock($resource)) {
            $this->exclusiveLock = null;
        }
        if ($this->hasSharedLock($resource)) {
            unset($this->sharedLock[$this->getResourceId($resource)]);
        }
    }
1339401
public function lock($uri, LockInfo $lockInfo)
    {
        // We're making the lock timeout 30 minutes
        $lockInfo->timeout = 1800;
        $lockInfo->created = time();
        $lockInfo->uri = $uri;

        $locks = $this->getData();

        foreach ($locks as $k => $lock) {
            if (
                ($lock->token == $lockInfo->token) ||
                (time() > $lock->timeout + $lock->created)
            ) {
                unset($locks[$k]);
            }
        }
        $locks[] = $lockInfo;
        $this->putData($locks);

        return true;
    }
22282
public static DirLock tryLock(FileSystem fs, Path dir) throws IOException {
    Path lockFile = getDirLockFile(dir);

    try {
      FSDataOutputStream ostream = HdfsUtils.tryCreateFile(fs, lockFile);
      if (ostream!=null) {
        LOG.debug("Thread ({}) Acquired lock on dir {}", threadInfo(), dir);
        ostream.close();
        return new DirLock(fs, lockFile);
      } else {
        LOG.debug("Thread ({}) cannot lock dir {} as its already locked.", threadInfo(), dir);
        return null;
      }
    } catch (IOException e) {
        LOG.error("Error when acquiring lock on dir " + dir, e);
        throw e;
    }
  }
446232
@Override
    public synchronized void releaseWriteLock(final Lock lock) {
        if (lock == null || lock.name == null || lock.name.isEmpty()) {
            throw new InvalidArgument("lock is invalid");
        }

        locks.remove(lock.name);

        final File writeLock = getWriteLock();
        if (!writeLock.delete()) {
            throw new IllegalStateException(
                    "write lock could not be deleted");
        }
    }
884985
public function unlockNode($uri, LockInfo $lockInfo)
    {
        if (!$this->server->emit('beforeUnlock', [$uri, $lockInfo])) {
            return;
        }

        return $this->locksBackend->unlock($uri, $lockInfo);
    }
23599
public function releaseLock($name)
    {
        if (isset($this->locks[$name])) {
            rmdir($this->getDirectoryPath($name));
            unset($this->locks[$name]);

            return true;
        }

        return false;
    }
1067888
protected function openLockFile()
    {
        if (!is_dir(dirname($this->lockfilePath))) {
            // Suppress warning on mkdir - may be created by another process
            @mkdir(dirname($this->lockfilePath), 0744, true);
        }
        $this->lockfp = fopen($this->lockfilePath, 'w+');
    }
449836
public function lock($document, $lockMode)
    {
        $id = $this->uow->getDocumentIdentifier($document);
        $criteria = array('_id' => $this->class->getDatabaseIdentifierValue($id));
        $lockMapping = $this->class->fieldMappings[$this->class->lockField];
        $this->collection->update($criteria, array('$set' => array($lockMapping['name'] => $lockMode)));
        $this->class->reflFields[$this->class->lockField]->setValue($document, $lockMode);
    }
1315354
@Override
    public FileLock lock(long position, long size, boolean shared) throws IOException
    {
        return new FileLockImpl(this, position, size, shared);
    }
1157152
private static function _stopReadLockProcessing(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->getFileObject(self::READ_LOCK_PROCESSING_LOCK_FILE);
        $lock->unlock();
    }
645744
public function read_lockfile() {
		$retval = null;
		if($this->is_lockfile_present()) {
			$retval = file_get_contents($this->get_lockfile());
		}
		else {
			throw new \Exception(__METHOD__ .": no lockfile exists");
		}
		return($retval);
	}