$filesLockSh = array_merge( $filesLockSh, $fileOp->storagePathsRead() );
$filesLockEx = array_merge( $filesLockEx, $fileOp->storagePathsChanged() );
}
+ // Optimization: if doing an EX lock anyway, don't also set an SH one
+ $filesLockSh = array_diff( $filesLockSh, $filesLockEx );
// Try to lock those files for the scope of this function...
$scopeLockS = $this->getScopedFileLocks( $filesLockSh, LockManager::LOCK_UW, $status );
$scopeLockE = $this->getScopedFileLocks( $filesLockEx, LockManager::LOCK_EX, $status );
$filesLockSh = array_merge( $filesLockSh, $fileOp->storagePathsRead() );
$filesLockEx = array_merge( $filesLockEx, $fileOp->storagePathsChanged() );
}
+ // Optimization: if doing an EX lock anyway, don't also set an SH one
+ $filesLockSh = array_diff( $filesLockSh, $filesLockEx );
// Lock the paths under the proxy backend's name
$this->unsubstPaths( $filesLockSh );
$this->unsubstPaths( $filesLockEx );