MediaWiki
REL1_21
|
Self-releasing locks. More...
Public Member Functions | |
__destruct () | |
Static Public Member Functions | |
static | factory (LockManager $manager, array $paths, $type, Status $status) |
Get a ScopedLock object representing a lock on resource paths. | |
static | release (ScopedLock &$lock=null) |
Release a scoped lock and set any errors in the attatched Status object. | |
Protected Member Functions | |
__construct (LockManager $manager, array $paths, $type, Status $status) | |
Protected Attributes | |
LockManager | $manager |
* | |
Array | $paths |
List of resource paths*. | |
Status | $status |
* | |
$type |
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 34 of file ScopedLock.php.
ScopedLock::__construct | ( | LockManager $ | manager, |
array $ | paths, | ||
$ | type, | ||
Status $ | status | ||
) | [protected] |
$manager | LockManager | |
array | $paths | List of storage paths |
$type | integer LockManager::LOCK_* constant | |
$status | Status |
Definition at line 47 of file ScopedLock.php.
Definition at line 91 of file ScopedLock.php.
static ScopedLock::factory | ( | LockManager $ | manager, |
array $ | paths, | ||
$ | type, | ||
Status $ | status | ||
) | [static] |
Get a ScopedLock object representing a lock on resource paths.
Any locks are released once this object goes out of scope. The status object is updated with any errors or warnings.
$manager | LockManager | |
array | $paths | List of storage paths |
$type | integer LockManager::LOCK_* constant | |
$status | Status |
Definition at line 67 of file ScopedLock.php.
static ScopedLock::release | ( | ScopedLock &$ | lock = null | ) | [static] |
Release a scoped lock and set any errors in the attatched Status 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 | $lock |
Definition at line 87 of file ScopedLock.php.
LockManager ScopedLock::$manager [protected] |
*
Definition at line 35 of file ScopedLock.php.
Array ScopedLock::$paths [protected] |
List of resource paths*.
Definition at line 37 of file ScopedLock.php.
Status ScopedLock::$status [protected] |
*
Definition at line 36 of file ScopedLock.php.
ScopedLock::$type [protected] |
Definition at line 39 of file ScopedLock.php.