summaryrefslogtreecommitdiff
path: root/includes/objectcache/BagOStuff.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
commit4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch)
treeaf68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/objectcache/BagOStuff.php
parentaf4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff)
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/objectcache/BagOStuff.php')
-rw-r--r--includes/objectcache/BagOStuff.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/objectcache/BagOStuff.php b/includes/objectcache/BagOStuff.php
index dd744672..857943ee 100644
--- a/includes/objectcache/BagOStuff.php
+++ b/includes/objectcache/BagOStuff.php
@@ -170,12 +170,12 @@ abstract class BagOStuff {
*/
public function lock( $key, $timeout = 60 ) {
$timestamp = microtime( true ); // starting UNIX timestamp
- if ( $this->add( "{$key}:lock", $timeout ) ) {
+ if ( $this->add( "{$key}:lock", 1, $timeout ) ) {
return true;
}
$uRTT = ceil( 1e6 * ( microtime( true ) - $timestamp ) ); // estimate RTT (us)
- $sleep = 2*$uRTT; // rough time to do get()+set()
+ $sleep = 2 * $uRTT; // rough time to do get()+set()
$locked = false; // lock acquired
$attempts = 0; // failed attempts
@@ -186,8 +186,8 @@ abstract class BagOStuff {
$sleep *= 2;
}
usleep( $sleep ); // back off
- $locked = $this->add( "{$key}:lock", $timeout );
- } while( !$locked );
+ $locked = $this->add( "{$key}:lock", 1, $timeout );
+ } while ( !$locked );
return $locked;
}