1 lock.inc | lock_release_all($lock_id = NULL) |
Release all previously acquired locks.
Related topics
File
- core/
includes/ lock.inc, line 259 - A database-mediated implementation of a locking mechanism.
Code
function lock_release_all($lock_id = NULL) {
global $locks;
$locks = array();
if (empty($lock_id)) {
$lock_id = _lock_id();
}
try {
db_delete('semaphore')
->condition('value', $lock_id)
->execute();
}
catch (PDOException $e) {
// PDOException 42S02 is the internal error code for table does not exist.
// In the event that the table does not exist, suppress the exception.
if ($e->getCode() !== '42S02') {
throw $e;
}
}
}