You are here

function lock_release_all in Memcache Storage 7

Release all previously acquired locks.

1 string reference to 'lock_release_all'
_lock_id in includes/lock.inc
Helper function to get this request's unique id.

File

includes/lock.inc, line 168
A memcached based implementation of a locking mechanism. See includes/lock.inc for documentation.

Code

function lock_release_all($lock_id = NULL) {
  global $locks;
  if (empty($lock_id)) {
    $lock_id = _lock_id();
  }

  // Remove all current locks from memcached pool.
  foreach ($locks as $name => $id) {
    $lock = MemcacheStorageAPI::get($name, 'semaphore');
    if ($lock && $lock == $lock_id) {
      MemcacheStorageAPI::delete($name, 'semaphore');
    }
  }

  // Clear global variable.
  $locks = array();
}