Releases a named lock.

@param string $lockName The lock name.
@return bool `true` if the lock was released, `false` if otherwise.
1194
public static function releaseDbLock($lockName)
    {
        $sql = 'SELECT RELEASE_LOCK(?)';

        $db = self::get();
        return $db->fetchOne($sql, array($lockName)) == '1';
    }
727461
public static function _acquire( $filename )
    {
        if (function_exists('sem_get')) {
            @sem_acquire(self::getResource(hexdec(md5($filename))));
            return true;
        } else {
            // Generate filename
            $lockfile = $filename.'.lock';

            // Wait until lock expired or gone
            while(file_exists($lockfile)) {
                $lockExpires = intval(@file_get_contents($lockfile));
                if($lockExpires<time()) {
                    unlink($lockfile);
                } else {
                    usleep(self::LOCK_WAIT);
                }
            }

            // Create a lock
            return file_put_contents($lockfile, sprintf("%d",time()+5)) !== false;
        }
    }
819254
public function lock () {
        if (!$this->beforeLock ()) {
            return false;
        }
        $redis = $this->getConnection ()->getClient ();
        if (!$redis->setnx ($this->name , $this->getExpiresAt (true))) {
            // see if this mutex has expired

            $value = $redis->get ($this->name);
            if ($value > microtime (true)) {
                return false;
            }
        }
        $this->afterLock ();
        return true;
    }
621514
public function release()
    {
        try {
            $this->lock->release();
        } catch (\Exception $ex) {
            throw new \RuntimeException(
                sprintf(
                    'Releasing the lock failed with the following message: %s',
                    $ex->getMessage()
                ),
                0,
                $ex
            );
        }
    }
822554
protected function addSessionLock(Lock $lock) {
    $locks = $this->getSessionLocks();
    $locks[$lock->getObjectId()->__toString()] = $lock;
    $this->session->set(self::SESSION_VARNAME, $locks);
  }
920077
protected function _rollback( $dbname = 'db' )
	{
		$dbm = $this->_context->getDatabaseManager();

		$conn = $dbm->acquire( $dbname );
		$conn->rollback();
		$dbm->release( $conn, $dbname );
	}
949279
public function lock(): bool
    {
        $result = false;

        if ($this->locker->acquireLock($this->timeout)) {
            $result = true;
        }

        return $result;
    }
1363449
public static function CacheReady($CacheName) {
      if (!array_key_exists($CacheName,self::$Caches))
         return FALSE;
         
      if (!sizeof(self::$Caches[$CacheName]['cache']))
         return FALSE;
         
      return TRUE;
   }
1267844
protected function _lock($object, $lock)
    {
        if ($lock) {
            self::$_locks[$object->getHandle()] = true;
        } else {
            unset(self::$_locks[$object->getHandle()]);
        }
    }
989328
public static function release()
	{
		if ( is_null( self::$authFileP ) ) return;
		$a = @flock( self::$authFileP , LOCK_UN );
		@fclose( self::$authFileP );
		self::$authFileP       = null;
		self::$currentlylocked = false;
	}
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;
    }
938603
public function release()
    {
        if (!$this->locked) {
            throw new \RuntimeException('release a non lock');
        }

        $unlock = flock($this->fp, LOCK_UN);
        fclose($this->fp);
        if ($unlock !== true) {
            return false;
        }
        $this->locked = false;

        return true;
    }
463021
protected function lock($name)
	{
		if (! array_key_exists($name, $this->locks)) {
			$this->locks[$name] = true;
			return true;
		}

		return false;
	}
657915
private function lock($name = null, $blocking = false)
    {
        if (!class_exists(SemaphoreStore::class)) {
            throw new LogicException('To enable the locking feature you must install the symfony/lock component.');
        }

        if (null !== $this->lock) {
            throw new LogicException('A lock is already in place.');
        }

        if (SemaphoreStore::isSupported()) {
            $store = new SemaphoreStore();
        } else {
            $store = new FlockStore();
        }

        $this->lock = (new Factory($store))->createLock($name ?: $this->getName());
        if (!$this->lock->acquire($blocking)) {
            $this->lock = null;

            return false;
        }

        return true;
    }
820073
public function auto_release() {
        // Called from the shutdown handler. Must release all open locks.
        foreach ($this->openlocks as $key => $unused) {
            $lock = new lock($key, $this);
            $lock->release();
        }
    }
896358
public function removeAttribute($attributeName)
	{
		if(array_key_exists($attributeName, $this->attributes) === false || in_array($attributeName, $this->lockedAttributes) === true)
			return;
		
		unset($this->attributes[$attributeName]);
	}
232941
@Override
    public synchronized void releaseReadLock(final Lock lock) {
        if (lock == null || lock.name == null || lock.name.isEmpty()) {
            throw new InvalidArgument("lock is invalid");
        }

        if (locks.containsKey(lock.name)) {
            locks.remove(lock.name);

            final Set<File> readLocks = getReadLocks();
            for (final File readLock : readLocks) {
                if (readLock.getName().endsWith(lock.name)) {
                    if (!readLock.delete()) {
                        throw new IllegalStateException(
                                "read lock could not be deleted");
                    }

                    readLocks.remove(readLock);
                    return;
                }
            }
        }

        throw new InvalidArgument("read lock '" + lock.name
                + "' is unknown");
    }