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

Breadcrumb

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

function PostgreSqlStore::unlockShared

3 calls to PostgreSqlStore::unlockShared()
PostgreSqlStore::delete in vendor/symfony/lock/Store/PostgreSqlStore.php
Removes a resource from the storage.
PostgreSqlStore::save in vendor/symfony/lock/Store/PostgreSqlStore.php
Stores the resource if it's not locked by someone else.
PostgreSqlStore::waitAndSave in vendor/symfony/lock/Store/PostgreSqlStore.php
Waits until a key becomes free, then stores the resource.

File

vendor/symfony/lock/Store/PostgreSqlStore.php, line 251

Class

PostgreSqlStore
PostgreSqlStore is a PersistingStoreInterface implementation using PostgreSql advisory locks.

Namespace

Symfony\Component\Lock\Store

Code

private function unlockShared(Key $key) : void {
    while (true) {
        $sql = "SELECT pg_advisory_unlock_shared(objid::bigint) FROM pg_locks WHERE locktype='advisory' AND mode='ShareLock' AND objid=:key AND pid=pg_backend_pid()";
        $stmt = $this->getConnection()
            ->prepare($sql);
        $stmt->bindValue(':key', $this->getHashedKey($key));
        $result = $stmt->execute();
        if (0 === $stmt->rowCount()) {
            break;
        }
    }
}

API Navigation

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