You are here

function memcache_test_lock_exit in Memcache API and Integration 6

Same name and namespace in other branches
  1. 7 tests/memcache_test.module \memcache_test_lock_exit()

Try to acquire a specific lock, and then exit.

2 string references to 'memcache_test_lock_exit'
LockFunctionalTest::testLockAcquire in tests/memcache-lock.test
Confirm that we can acquire and release locks in two parallel requests.
memcache_test_menu in tests/memcache_test.module
Implements hook_menu().

File

tests/memcache_test.module, line 42

Code

function memcache_test_lock_exit() {
  dmemcache_key(FALSE, FALSE, TRUE);
  $GLOBALS['drupal_test_info']['test_run_id'] = arg(2);
  if (lock_acquire('memcache_test_lock_exit', 900)) {
    echo 'TRUE: Lock successfully acquired in memcache_test_lock_exit()';

    // The shut-down function should release the lock.
    exit;
  }
  else {
    return 'FALSE: Lock not acquired in memcache_test_lock_exit()';
  }
}