You are here

public function LockBackendInterface::acquire in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::acquire()

Acquires a lock.

Parameters

string $name: Lock name. Limit of name's length is 255 characters.

float $timeout: (optional) Lock lifetime in seconds. Defaults to 30.0.

Return value

bool

4 methods override LockBackendInterface::acquire()
DatabaseLockBackend::acquire in core/lib/Drupal/Core/Lock/DatabaseLockBackend.php
Acquires a lock.
DatabaseLockBackend::acquire in core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php
Acquires a lock.
NullLockBackend::acquire in core/lib/Drupal/Core/Lock/NullLockBackend.php
Acquires a lock.
PersistentDatabaseLockBackend::acquire in core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php
Acquires a lock.

File

core/lib/Drupal/Core/Lock/LockBackendInterface.php, line 95

Class

LockBackendInterface
Lock backend interface.

Namespace

Drupal\Core\Lock

Code

public function acquire($name, $timeout = 30.0);