summaryrefslogtreecommitdiff
path: root/includes/poolcounter/PoolCounterRedis.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/poolcounter/PoolCounterRedis.php')
-rw-r--r--includes/poolcounter/PoolCounterRedis.php17
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 );
}