Exemplo n.º 1
0
 public function testReleaseAfterReleaseAll()
 {
     $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
     $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
     $this->instance->releaseAll();
     $this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
     $this->instance->releaseLock('foo', ILockingProvider::LOCK_SHARED);
 }
Exemplo n.º 2
0
 /**
  * @param string $path
  * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
  * @param \OCP\Lock\ILockingProvider $provider
  */
 public function releaseLock($path, $type, ILockingProvider $provider)
 {
     $provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
 }