You are here

function lock_release in Drupal driver for SQL Server and SQL Azure 7.2

Same name and namespace in other branches
  1. 7.3 sqlsrv/lock.inc \lock_release()

Release a lock previously acquired by lock_acquire().

This will release the named lock if it is still held by the current request.

Parameters

$name: The name of the lock.

Related topics

File

sqlsrv/lock.inc, line 250
A database-mediated implementation of a locking mechanism.

Code

function lock_release($name) {
  global $locks;
  unset($locks[$name]);
  db_delete('semaphore')
    ->condition('name', $name)
    ->condition('value', _lock_id())
    ->execute();
}