diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:31:04 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:58:39 +0200 |
commit | f6d65e533c62f6deb21342d4901ece24497b433e (patch) | |
tree | f28adf0362d14bcd448f7b65a7aaf38650f923aa /includes/poolcounter/PoolCounterRedis.php | |
parent | c27b2e832fe25651ef2410fae85b41072aae7519 (diff) |
Update to MediaWiki 1.25.1
Diffstat (limited to 'includes/poolcounter/PoolCounterRedis.php')
-rw-r--r-- | includes/poolcounter/PoolCounterRedis.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/includes/poolcounter/PoolCounterRedis.php b/includes/poolcounter/PoolCounterRedis.php index d609f614..98797a30 100644 --- a/includes/poolcounter/PoolCounterRedis.php +++ b/includes/poolcounter/PoolCounterRedis.php @@ -121,19 +121,26 @@ class PoolCounterRedis extends PoolCounter { } function acquireForMe() { - $section = new ProfileSection( __METHOD__ ); + + $status = $this->precheckAcquire(); + if ( !$status->isGood() ) { + return $status; + } return $this->waitForSlotOrNotif( self::AWAKE_ONE ); } function acquireForAnyone() { - $section = new ProfileSection( __METHOD__ ); + + $status = $this->precheckAcquire(); + if ( !$status->isGood() ) { + return $status; + } return $this->waitForSlotOrNotif( self::AWAKE_ALL ); } function release() { - $section = new ProfileSection( __METHOD__ ); if ( $this->slot === null ) { return Status::newGood( PoolCounter::NOT_LOCKED ); // not locked @@ -207,6 +214,8 @@ LUA; $this->onRelease = null; unset( self::$active[$this->session] ); + $this->onRelease(); + return Status::newGood( PoolCounter::RELEASED ); } @@ -266,6 +275,8 @@ LUA; self::$active[$this->session] = $this; } + $this->onAcquire(); + return Status::newGood( $slot === 'w' ? PoolCounter::DONE : PoolCounter::LOCKED ); } |