[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/filebackend/lockmanager/ -> ScopedLock.php (summary)

Resource locking handling. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Author: Aaron Schulz
File Size: 105 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ScopedLock:: (4 methods):
  __construct()
  factory()
  release()
  __destruct()


Class: ScopedLock  - X-Ref

Self-releasing locks

LockManager helper class to handle scoped locks, which
release when an object is destroyed or goes out of scope.

__construct( LockManager $manager, array $pathsByType, Status $status )   X-Ref

param: LockManager $manager
param: array $pathsByType Map of lock types to path lists
param: Status $status

factory(LockManager $manager, array $paths, $type, Status $status, $timeout = 0)   X-Ref
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.

param: LockManager $manager
param: array $paths List of storage paths or map of lock types to path lists
param: int|string $type LockManager::LOCK_* constant or "mixed" and $paths
param: Status $status
param: int $timeout Timeout in seconds (0 means non-blocking) (since 1.22)
return: ScopedLock|null Returns null on failure

release( ScopedLock &$lock = null )   X-Ref
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.

param: ScopedLock $lock

__destruct()   X-Ref
Release the locks when this goes out of scope




Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1