Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Lock.php

function Lock::release

Overrides LockInterface::release

4 calls to Lock::release()
Lock::acquire in vendor/symfony/lock/Lock.php
Acquires the lock. If the lock is acquired by someone else, the parameter `blocking` determines whether or not the call should block until the release of the lock.
Lock::acquireRead in vendor/symfony/lock/Lock.php
Acquires the lock for reading. If the lock is acquired by someone else in write mode, the parameter `blocking` determines whether or not the call should block until the release of the lock.
Lock::refresh in vendor/symfony/lock/Lock.php
Increase the duration of an acquired lock.
Lock::__destruct in vendor/symfony/lock/Lock.php
Automatically releases the underlying lock when the object is destructed.

File

vendor/symfony/lock/Lock.php, line 214

Class

Lock
Lock is the default implementation of the LockInterface.

Namespace

Symfony\Component\Lock

Code

public function release() : void {
    try {
        try {
            $this->store
                ->delete($this->key);
            $this->dirty = false;
        } catch (LockReleasingException $e) {
            throw $e;
        } catch (\Exception $e) {
            throw new LockReleasingException(\sprintf('Failed to release the "%s" lock.', $this->key), 0, $e);
        }
        if ($this->store
            ->exists($this->key)) {
            throw new LockReleasingException(\sprintf('Failed to release the "%s" lock, the resource is still locked.', $this->key));
        }
        $this->logger?->debug('Successfully released the "{resource}" lock.', [
            'resource' => $this->key,
        ]);
    } catch (LockReleasingException $e) {
        $this->logger?->notice('Failed to release the "{resource}" lock.', [
            'resource' => $this->key,
        ]);
        throw $e;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal