18 protected function doLock( array $paths, $type ) {
19 foreach ( $paths as
$path ) {
20 if ( isset( $this->locksHeld[
$path][$type] ) ) {
21 ++$this->locksHeld[
$path][$type];
23 $this->locksHeld[
$path][$type] = 1;
27 return StatusValue::newGood();
31 protected function doUnlock( array $paths, $type ) {
32 $status = StatusValue::newGood();
34 foreach ( $paths as
$path ) {
35 if ( isset( $this->locksHeld[
$path][$type] ) ) {
36 if ( --$this->locksHeld[
$path][$type] <= 0 ) {
37 unset( $this->locksHeld[
$path][$type] );
38 if ( !$this->locksHeld[
$path] ) {
39 unset( $this->locksHeld[
$path] );
43 $status->warning(
'lockmanager-notlocked',
$path );
51class_alias( NullLockManager::class,
'NullLockManager' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.