yii\mutex\PgsqlMutex::acquireLock PHP Метод

acquireLock() защищенный Метод

Acquires lock by given name.
См. также: http://www.postgresql.org/docs/9.0/static/functions-admin.html
protected acquireLock ( string $name, integer $timeout ) : boolean
$name string of the lock to be acquired.
$timeout integer to wait for lock to become released.
Результат boolean acquiring result.
    protected function acquireLock($name, $timeout = 0)
    {
        if ($timeout !== 0) {
            throw new InvalidParamException('PgsqlMutex does not support timeout.');
        }
        list($key1, $key2) = $this->getKeysFromName($name);
        return (bool) $this->db->createCommand('SELECT pg_try_advisory_lock(:key1, :key2)', [':key1' => $key1, ':key2' => $key2])->queryScalar();
    }