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\StoreCode
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;
}
}
}