From ce04cf6610ffd823ef1cb5ab3ee215b69afffcb4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 May 2015 16:35:49 +0200 Subject: shared lock around hooks --- lib/private/lock/memcachelockingprovider.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/private/lock') diff --git a/lib/private/lock/memcachelockingprovider.php b/lib/private/lock/memcachelockingprovider.php index 368ff450325..26957f8ceda 100644 --- a/lib/private/lock/memcachelockingprovider.php +++ b/lib/private/lock/memcachelockingprovider.php @@ -110,11 +110,15 @@ class MemcacheLockingProvider implements ILockingProvider { if (!$this->memcache->cas($path, 'exclusive', 1)) { throw new LockedException($path); } + unset($this->acquiredLocks['exclusive'][$path]); + $this->acquiredLocks['shared'][$path]++; } else if ($targetType === self::LOCK_EXCLUSIVE) { // we can only change a shared lock to an exclusive if there's only a single owner of the shared lock if (!$this->memcache->cas($path, 1, 'exclusive')) { throw new LockedException($path); } + $this->acquiredLocks['exclusive'][$path] = true; + $this->acquiredLocks['shared'][$path]--; } } -- cgit v1.2.3