Commit aa0f7ff9 authored by Alan Evans's avatar Alan Evans Committed by Jeremy

Issue #2379897 by Alan Evans: cconfirm lock_id before releasing lock

parent 6037ca1c
......@@ -133,9 +133,11 @@ function lock_wait($name, $delay = 30) {
function lock_release($name) {
global $locks;
dmemcache_delete($name, 'semaphore');
// We unset unconditionally since caller assumes lock is released anyway.
unset($locks[$name]);
if (dmemcache_get($name, 'semaphore') == $locks[$name]) {
dmemcache_delete($name, 'semaphore');
// We unset unconditionally since caller assumes lock is released anyway.
unset($locks[$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