DBLockingProvider

class OC\Lock\DBLockingProvider
Locking provider that stores the locks in the database
Source:lib/private/Lock/DBLockingProvider.php#42
Parent:OC\Lock\AbstractLockingProvider

Properties

Methods

protected OC\Lock\DBLockingProvider::isLocallyLocked($path)
Check if we have an open shared lock for a path
Source:

lib/private/Lock/DBLockingProvider.php#71

Parameters:
  • $path (string)
Returns:

bool

protected OC\Lock\DBLockingProvider::markAcquire($path, $type)
Mark a locally acquired lock
Source:

lib/private/Lock/DBLockingProvider.php#81

Parameters:
  • $path (string)
  • $type (int) self::LOCK_SHARED or self::LOCK_EXCLUSIVE
protected OC\Lock\DBLockingProvider::markChange($path, $targetType)
Change the type of an existing tracked lock
Source:

lib/private/Lock/DBLockingProvider.php#96

Parameters:
  • $path (string)
  • $targetType (int) self::LOCK_SHARED or self::LOCK_EXCLUSIVE
public OC\Lock\DBLockingProvider::__construct($connection, $logger, $timeFactory, $ttl=3600, $cacheSharedLocks=true)
Source:

lib/private/Lock/DBLockingProvider.php#114

Parameters:
protected OC\Lock\DBLockingProvider::initLockField($path, $lock=0)
Insert a file locking row if it does not exists.
Source:

lib/private/Lock/DBLockingProvider.php#135

Parameters:
  • $path (string)
  • $lock (int)
Returns:

int number of inserted rows

protected OC\Lock\DBLockingProvider::getExpireTime()
Source:lib/private/Lock/DBLockingProvider.php#147
Returns:int
public OC\Lock\DBLockingProvider::isLocked($path, $type)
Source:

lib/private/Lock/DBLockingProvider.php#156

Parameters:
  • $path (string)
  • $type (int) self::LOCK_SHARED or self::LOCK_EXCLUSIVE
Returns:

bool

public OC\Lock\DBLockingProvider::acquireLock($path, $type, $readablePath=null)
Source:

lib/private/Lock/DBLockingProvider.php#182

Parameters:
  • $path (string)
  • $type (int) self::LOCK_SHARED or self::LOCK_EXCLUSIVE
Throws:

\OCP\Lock\LockedException

public OC\Lock\DBLockingProvider::releaseLock($path, $type)
Source:

lib/private/Lock/DBLockingProvider.php#219

Parameters:
  • $path (string)
  • $type (int) self::LOCK_SHARED or self::LOCK_EXCLUSIVE
public OC\Lock\DBLockingProvider::changeLock($path, $targetType)
Change the type of an existing lock
Source:

lib/private/Lock/DBLockingProvider.php#245

Parameters:
  • $path (string)
  • $targetType (int) self::LOCK_SHARED or self::LOCK_EXCLUSIVE
Throws:

\OCP\Lock\LockedException

public OC\Lock\DBLockingProvider::cleanExpiredLocks()
cleanup empty locks
Source:lib/private/Lock/DBLockingProvider.php#271
public OC\Lock\DBLockingProvider::releaseAll()
release all lock acquired by this instance which were marked using the mark* methods
Source:lib/private/Lock/DBLockingProvider.php#289