function system_test_lock_acquire

Try to acquire a named lock and report the outcome.

2 string references to 'system_test_lock_acquire'
LockFunctionalTest::testLockAcquire in drupal/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php
Confirms that we can acquire and release locks in two parallel requests.
system_test_menu in drupal/core/modules/system/tests/modules/system_test/system_test.module
Implements hook_menu().

File

drupal/core/modules/system/tests/modules/system_test/system_test.module, line 170

Code

function system_test_lock_acquire() {
  if (lock()
    ->acquire('system_test_lock_acquire')) {
    lock()
      ->release('system_test_lock_acquire');
    return 'TRUE: Lock successfully acquired in system_test_lock_acquire()';
  }
  else {
    return 'FALSE: Lock not acquired in system_test_lock_acquire()';
  }
}