Commit 6037ca1c authored by Alan Evans's avatar Alan Evans Committed by Jeremy

Issue #2379883 by Alan Evans, Jeremy: fix broken logic and order of precedence...

Issue #2379883 by Alan Evans, Jeremy: fix broken logic and order of precedence error in lock_acquire so lock renewal works correctly
parent 773d3e81
......@@ -39,7 +39,7 @@ function lock_acquire($name, $timeout = 30) {
if (dmemcache_add($name, _lock_id(), $timeout, 'semaphore')) {
$locks[$name] = _lock_id();
}
elseif ($result = dmemcache_get($name, 'semaphore') && isset($locks[$name]) && $locks[$name] == _lock_id()) {
elseif (($result = dmemcache_get($name, 'semaphore')) && isset($locks[$name]) && $locks[$name] == $result) {
// Only renew the lock if we already set it and it has not expired.
dmemcache_set($name, _lock_id(), $timeout, 'semaphore');
}
......
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