diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-05-29 16:35:49 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-06-01 13:24:02 +0200 |
commit | ce04cf6610ffd823ef1cb5ab3ee215b69afffcb4 (patch) | |
tree | 8ed8438abb693f06c56dc1b404f7778f8df4e0f0 /lib/private/lock | |
parent | 661c9e2444c097aad7e47b77df4fc2b10c346d04 (diff) | |
download | nextcloud-server-ce04cf6610ffd823ef1cb5ab3ee215b69afffcb4.tar.gz nextcloud-server-ce04cf6610ffd823ef1cb5ab3ee215b69afffcb4.zip |
shared lock around hooks
Diffstat (limited to 'lib/private/lock')
-rw-r--r-- | lib/private/lock/memcachelockingprovider.php | 4 |
1 files changed, 4 insertions, 0 deletions
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]--; } } |