public function LockBackendInterface::acquire in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::acquire()
- 9 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
2 methods override LockBackendInterface::acquire()
- DatabaseLockBackend::acquire in core/
lib/ Drupal/ Core/ ProxyClass/ Lock/ DatabaseLockBackend.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\LockCode
public function acquire($name, $timeout = 30.0);