Commit e804db00 authored by mikeytown2's avatar mikeytown2

Issue #2402287 by mikeytown2: Use apdqc locking if available.

parent 34da9c46
......@@ -2375,7 +2375,8 @@ function httprl_acquire_headless_lock($name, $time = 60) {
unset($locks[$name]);
// Remove the lock_id reference in the database.
if (httprl_variable_get('lock_inc', './includes/lock.inc') === './includes/lock.inc') {
$lock_inc = httprl_variable_get('lock_inc', './includes/lock.inc');
if ($lock_inc === './includes/lock.inc') {
if (defined('VERSION') && substr(VERSION, 0, 1) >= 7) {
db_update('semaphore')
->fields(array('value' => 'httprl'))
......@@ -2387,6 +2388,9 @@ function httprl_acquire_headless_lock($name, $time = 60) {
db_query("UPDATE {semaphore} SET value = '%s' WHERE name = '%s' AND value = '%s'", 'httprl', $name, _lock_id());
}
}
elseif (strpos($lock_inc, '/apdqc/apdqc.lock.inc') !== FALSE) {
lock_change_lock_id($name, _lock_id(), 'httprl');
}
return TRUE;
}
......@@ -2713,6 +2717,9 @@ function httprl_lock_release($name) {
MemcacheStorageAPI::delete($name, 'semaphore');
}
}
elseif (strpos($lock_inc, '/apdqc/apdqc.lock.inc') !== FALSE) {
lock_release_fuzzy($name);
}
else {
lock_release($name);
}
......
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