Removes a lock from a uri.

@param string   $uri
@param LockInfo $lockInfo

@return bool
7670
public function unlock($uri, LockInfo $lockInfo)
    {
        $stmt = $this->pdo->prepare('DELETE FROM '.$this->tableName.' WHERE uri = ? AND token = ?');
        $stmt->execute([$uri, $lockInfo->token]);

        return 1 === $stmt->rowCount();
    }
1111642
public void removeLocks(CmsUUID userId) {

        Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator();
        while (itLocks.hasNext()) {
            CmsLock currentLock = itLocks.next();
            boolean editLock = currentLock.getEditionLock().getUserId().equals(userId);
            boolean sysLock = currentLock.getSystemLock().getUserId().equals(userId);
            if (editLock) {
                unlockResource(currentLock.getResourceName(), false);
            }
            if (sysLock) {
                unlockResource(currentLock.getResourceName(), true);
            }
        }
    }
853577
public function removeReferenceUri(string $fqn, string $uri)
    {
        if (!isset($this->references[$fqn])) {
            return;
        }
        $index = array_search($fqn, $this->references[$fqn], true);
        if ($index === false) {
            return;
        }
        array_splice($this->references[$fqn], $index, 1);
    }
1022791
protected function assertUnlocked(GitUserInterface $user, FilePath $lockPath)
    {
        if (!$this->fileSystemService->exists($lockPath)) {
            return true;
        }

        if ($this->isLockExpired($lockPath)) {
            return true;
        }

        $lockLogin = $this->getLockLogin($lockPath);
        if ($lockLogin == $user->getGitUserEmail()) {
            return true;
        }

        throw new FileLockedException($lockLogin, $this->getLockExpiry($lockPath));
    }
234833
public function clearLock($name)
    {
        if (!isset($this->locks[$name])) {
            return false;
        }

        unset($this->locks[$name]);
        return true;
    }
1206730
public function releaseLock(core_kernel_classes_Resource $resource, $ownerId)
	{
		$lock = $resource->getPropertyValues( $this->getLockProperty () );
		if (count ( $lock ) == 0) {
			return false;
		} elseif (count ( $lock ) > 1) {
			throw new common_exception_InconsistentData('Bad data in lock');
		} else {
			$lockdata = OntoLockData::getLockData ( array_pop ( $lock ) );
			if ($lockdata->getOwnerId() == $ownerId) {
				$resource->removePropertyValues( $this->getLockProperty() );
				return true;
			} else {
				throw new common_exception_Unauthorized ( "The resource is owned by " . $lockdata->getOwnerId ());
			}
		}
	}
307717
public function release_lock($key, $ownerid) {
        if ($this->check_lock_state($key, $ownerid)) {
            return ($this->redis->del($key) !== false);
        }
        return false;
    }
58159
public static function releaseWriteLock(Zend_Search_Lucene_Storage_Directory $lockDirectory)
    {
        $lock = $lockDirectory->getFileObject(self::WRITE_LOCK_FILE);
        $lock->unlock();
    }
468917
public function release_lock(lock $lock) {
        $params = array('locktype' => $this->dblockid,
                        'token' => $lock->get_key());
        $result = $this->db->get_record_sql('SELECT pg_advisory_unlock(:locktype, :token) AS unlocked', $params);
        $result = $result->unlocked === 't';
        if ($result) {
            unset($this->openlocks[$lock->get_key()]);
        }
        return $result;
    }
593556
private function executeInLock($lockName, callable $callback)
    {
        $this->res->getManagementLock()->lock($lockName);

        try {
            return call_user_func($callback);
        } finally {
            $this->res->getManagementLock()->unlock($lockName);
        }
    }
363961
public function lockSiteOrExit()
    {
        touch($this->lockFlagPathAndFilename);
        $this->lockResource = fopen($this->lockPathAndFilename, 'w+');
        if (!flock($this->lockResource, LOCK_EX | LOCK_NB)) {
            fclose($this->lockResource);
            $this->doExit();
        }
    }
541427
public function toggle($action, $resource = null, $resourceId = null)
    {
        $this->assertLockInstanceIsSet();

        $this->lock->toggle($action, $resource, $resourceId);
    }
1197799
public function lock($locked = true)
    {
        $this->_locked = $locked === false ? false : true;
        return $this;
    }
939788
public function deleteByUri(string $uri) {
        if (!isset($this->cache[$uri])) {
            throw new NotInCache();
        }
        foreach ($this->uri2id[$uri] as $id) {
            unset($this->id2uri[$id]);
        }
        unset($this->uri2id[$uri]);
        unset($this->cache[$uri]);
    }
1023093
public function revoke($permissions, $resourceName = null, $resourceId = null)
    {
        return $this->lock()->deny($permissions, $resourceName, $resourceId);
    }
982575
public function clear($action = null, $resource = null, $resourceId = null)
    {
        $actions = (array) $action;
        $resourceObject = $this->convertResourceToObject($resource, $resourceId);
        $permissions = $this->getPermissions();

        if ($action === null && $resource === null) {
            // Clear every permission for this lock instance.
            foreach ($permissions as $permission) {
                $this->removePermission($permission);
            }
        } elseif ($action === null && $resource !== null) {
            // Clear all permissions for a given resource.
            /** @todo Needs to be implemented */
        } else {
            // Clear every permission for the given actions.
            foreach ($actions as $action) {
                $this->clearPermission($action, $resourceObject, $permissions);
            }
        }
    }
1304548
public function cannot($action, $resource = null, $resourceId = null)
    {
        $this->assertLockInstanceIsSet();

        return $this->lock->cannot($action, $resource, $resourceId);
    }