function PostgreSqlStore::unlock
3 calls to PostgreSqlStore::unlock()
- PostgreSqlStore::delete in vendor/
symfony/ lock/ Store/ PostgreSqlStore.php - Removes a resource from the storage.
- PostgreSqlStore::saveRead in vendor/
symfony/ lock/ Store/ PostgreSqlStore.php - Stores the resource if it's not locked for reading by someone else.
- PostgreSqlStore::waitAndSaveRead in vendor/
symfony/ lock/ Store/ PostgreSqlStore.php - Waits until a key becomes free for reading, then stores the resource.
File
-
vendor/
symfony/ lock/ Store/ PostgreSqlStore.php, line 237
Class
- PostgreSqlStore
- PostgreSqlStore is a PersistingStoreInterface implementation using PostgreSql advisory locks.
Namespace
Symfony\Component\Lock\StoreCode
private function unlock(Key $key) : void {
while (true) {
$sql = "SELECT pg_advisory_unlock(objid::bigint) FROM pg_locks WHERE locktype='advisory' AND mode='ExclusiveLock' 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;
}
}
}