function _lock_id
Same name and namespace in other branches
- 7.x drupal-7.x/includes/lock.inc \_lock_id()
Helper function to get this request's unique id.
Related topics
3 calls to _lock_id()
- lock_acquire in drupal-6.x/
includes/ lock.inc - Acquire (or renew) a lock, but do not block if it fails.
- lock_release in drupal-6.x/
includes/ lock.inc - Release a lock previously acquired by lock_acquire().
- lock_release_all in drupal-6.x/
includes/ lock.inc - Release all previously acquired locks.
Archivo
- drupal-6.x/
includes/ lock.inc, line 74 - A database-mediated implementation of a locking mechanism.
Código
function _lock_id() {
static $lock_id;
if (!isset($lock_id)) {
// Assign a unique id.
$lock_id = uniqid(mt_rand(), TRUE);
// We only register a shutdown function if a lock is used.
register_shutdown_function('lock_release_all', $lock_id);
}
return $lock_id;
}