summaryrefslogtreecommitdiffstats
path: root/lib/private/lock/memcachelockingprovider.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-05-20 16:25:41 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-01 13:22:56 +0200
commit006eaa84aa25b6301fc75cdf2fbf2594e21b4271 (patch)
tree39c9b5cba5659962d779c4354cfbdb7a6caf6ca5 /lib/private/lock/memcachelockingprovider.php
parentf0b86727299728bb7243e99584a21038c54123cd (diff)
downloadnextcloud-server-006eaa84aa25b6301fc75cdf2fbf2594e21b4271.tar.gz
nextcloud-server-006eaa84aa25b6301fc75cdf2fbf2594e21b4271.zip
dont release shared lock if we dont have any
Diffstat (limited to 'lib/private/lock/memcachelockingprovider.php')
-rw-r--r--lib/private/lock/memcachelockingprovider.php6
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]);