function _lock_id

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 lock.inc _lock_id()
cle7 lock.inc _lock_id()
elmsmedia7 lock.inc _lock_id()
icor7 lock.inc _lock_id()
meedjum_blog7 lock.inc _lock_id()
mooc7 lock.inc _lock_id()

Helper function to get this request's unique id.

Related topics

4 calls to _lock_id()
httprl_acquire_lock in sites/all/modules/ulmus/httprl/httprl.module
Get a lock so background calls work.
lock_acquire in includes/lock.inc
Acquire (or renew) a lock, but do not block if it fails.
lock_release in includes/lock.inc
Release a lock previously acquired by lock_acquire().
lock_release_all in includes/lock.inc
Release all previously acquired locks.

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;
}