Commit fd3a4481 authored by mikeytown2's avatar mikeytown2

Issue #2019325 by mikeytown2: Always decouple a lock from the generating process.

parent 885ccfce
......@@ -2079,23 +2079,21 @@ function httprl_acquire_lock(&$result) {
}
// Make sure lock exists after this process is dead.
if (!empty($result->options['blocking'])) {
// Remove from the global locks variable.
global $locks;
unset($locks[$name]);
// Remove from the global locks variable.
global $locks;
unset($locks[$name]);
// Remove the lock_id reference in the database.
if (httprl_variable_get('lock_inc', './includes/lock.inc') === './includes/lock.inc') {
if (defined('VERSION') && substr(VERSION, 0, 1) >= 7) {
db_update('semaphore')
->fields(array('value' => 'httprl'))
->condition('name', $name)
->condition('value', _lock_id())
->execute();
}
else {
db_query("UPDATE {semaphore} SET value = '%s' WHERE name = '%s' AND value = '%s'", 'httprl', $name, _lock_id());
}
// Remove the lock_id reference in the database.
if (httprl_variable_get('lock_inc', './includes/lock.inc') === './includes/lock.inc') {
if (defined('VERSION') && substr(VERSION, 0, 1) >= 7) {
db_update('semaphore')
->fields(array('value' => 'httprl'))
->condition('name', $name)
->condition('value', _lock_id())
->execute();
}
else {
db_query("UPDATE {semaphore} SET value = '%s' WHERE name = '%s' AND value = '%s'", 'httprl', $name, _lock_id());
}
}
return TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment