MediaWiki
1.34.0
|
Self-releasing locks. More...
Public Member Functions | |
__destruct () | |
Release the locks when this goes out of scope. More... | |
Static Public Member Functions | |
static | factory (LockManager $manager, array $paths, $type, StatusValue $status, $timeout=0) |
Get a ScopedLock object representing a lock on resource paths. More... | |
static | release (ScopedLock &$lock=null) |
Release a scoped lock and set any errors in the attatched StatusValue object. More... | |
Protected Member Functions | |
__construct (LockManager $manager, array $pathsByType, StatusValue $status) | |
Protected Attributes | |
LockManager | $manager |
array | $pathsByType |
Map of lock types to resource paths. More... | |
StatusValue | $status |
Self-releasing locks.
LockManager helper class to handle scoped locks, which release when an object is destroyed or goes out of scope.
Definition at line 33 of file ScopedLock.php.
|
protected |
LockManager | $manager | |
array | $pathsByType | Map of lock types to path lists |
StatusValue | $status |
Definition at line 48 of file ScopedLock.php.
References $manager, $pathsByType, and $status.
ScopedLock::__destruct | ( | ) |
Release the locks when this goes out of scope.
Definition at line 98 of file ScopedLock.php.
|
static |
Get a ScopedLock object representing a lock on resource paths.
Any locks are released once this object goes out of scope. The StatusValue object is updated with any errors or warnings.
LockManager | $manager | |
array | $paths | List of storage paths or map of lock types to path lists |
int | string | $type | LockManager::LOCK_* constant or "mixed" and $paths can be a map of types to paths (since 1.22). Otherwise $type should be an integer and $paths should be a list of paths. |
StatusValue | $status | |
int | $timeout | Timeout in seconds (0 means non-blocking) (since 1.22) |
Definition at line 70 of file ScopedLock.php.
References $manager, $pathsByType, $status, $type, LockManager\lockByType(), and StatusValue\merge().
Referenced by FileBackend\getScopedFileLocks().
|
static |
Release a scoped lock and set any errors in the attatched StatusValue object.
This is useful for early release of locks before function scope is destroyed. This is the same as setting the lock object to null.
ScopedLock | null | &$lock |
Definition at line 91 of file ScopedLock.php.
|
protected |
Definition at line 35 of file ScopedLock.php.
Referenced by __construct(), and factory().
|
protected |
Map of lock types to resource paths.
Definition at line 41 of file ScopedLock.php.
Referenced by __construct(), and factory().
|
protected |
Definition at line 38 of file ScopedLock.php.
Referenced by __construct(), and factory().