mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
dont release shared lock if we dont have any
This commit is contained in:
parent
f0b8672729
commit
006eaa84aa
1 changed files with 4 additions and 2 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue