Index: trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php |
— | — | @@ -82,6 +82,8 @@ |
83 | 83 | $filesLockSh = array_merge( $filesLockSh, $fileOp->storagePathsRead() ); |
84 | 84 | $filesLockEx = array_merge( $filesLockEx, $fileOp->storagePathsChanged() ); |
85 | 85 | } |
| 86 | + // Optimization: if doing an EX lock anyway, don't also set an SH one |
| 87 | + $filesLockSh = array_diff( $filesLockSh, $filesLockEx ); |
86 | 88 | // Lock the paths under the proxy backend's name |
87 | 89 | $this->unsubstPaths( $filesLockSh ); |
88 | 90 | $this->unsubstPaths( $filesLockEx ); |
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -743,6 +743,8 @@ |
744 | 744 | $filesLockSh = array_merge( $filesLockSh, $fileOp->storagePathsRead() ); |
745 | 745 | $filesLockEx = array_merge( $filesLockEx, $fileOp->storagePathsChanged() ); |
746 | 746 | } |
| 747 | + // Optimization: if doing an EX lock anyway, don't also set an SH one |
| 748 | + $filesLockSh = array_diff( $filesLockSh, $filesLockEx ); |
747 | 749 | // Try to lock those files for the scope of this function... |
748 | 750 | $scopeLockS = $this->getScopedFileLocks( $filesLockSh, LockManager::LOCK_UW, $status ); |
749 | 751 | $scopeLockE = $this->getScopedFileLocks( $filesLockEx, LockManager::LOCK_EX, $status ); |