diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/lock/memcachelockingprovider.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/lock/memcachelockingprovider.php b/lib/private/lock/memcachelockingprovider.php index b2938e3a8ce..1334d007314 100644 --- a/lib/private/lock/memcachelockingprovider.php +++ b/lib/private/lock/memcachelockingprovider.php @@ -88,8 +88,10 @@ class MemcacheLockingProvider implements ILockingProvider { */ public function releaseLock($path, $type) { if ($type === self::LOCK_SHARED) { - $this->memcache->dec($path); - $this->acquiredLocks['shared'][$path]--; + if (isset($this->acquiredLocks['shared'][$path]) and $this->acquiredLocks['shared'][$path] > 0) { + $this->memcache->dec($path); + $this->acquiredLocks['shared'][$path]--; + } } else if ($type === self::LOCK_EXCLUSIVE) { $this->memcache->cas($path, 'exclusive', 0); unset($this->acquiredLocks['exclusive'][$path]); |