[Pkg-owncloud-commits] [owncloud] 218/457: dont release shared lock if we dont have any

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 006eaa84aa25b6301fc75cdf2fbf2594e21b4271
Author: Robin Appelman <icewind at owncloud.com>
Date:   Wed May 20 16:25:41 2015 +0200

    dont release shared lock if we dont have any
---
 lib/private/lock/memcachelockingprovider.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/private/lock/memcachelockingprovider.php b/lib/private/lock/memcachelockingprovider.php
index b2938e3..1334d00 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]);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list