On this page
function _lock_id
_lock_id()
Helper function to get this request's unique id.
Related topics
File
- includes/lock.inc, line 76
- A database-mediated implementation of a locking mechanism.
Code
function _lock_id() {
// Do not use drupal_static(). This identifier refers to the current
// client request, and must not be changed under any circumstances
// else the shutdown handler may fail to release our locks.
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.
drupal_register_shutdown_function('lock_release_all', $lock_id);
}
return $lock_id;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!lock.inc/function/_lock_id/7.x