From 475d7d3e47493d1b5072572e8775ad8d24b54870 Mon Sep 17 00:00:00 2001 From: yf <291323003@qq.com> Date: Tue, 22 Jan 2019 22:05:26 +0800 Subject: [PATCH] fix bug --- src/Pool/AbstractPool.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Pool/AbstractPool.php b/src/Pool/AbstractPool.php index ccfd497..c4dec28 100644 --- a/src/Pool/AbstractPool.php +++ b/src/Pool/AbstractPool.php @@ -87,6 +87,8 @@ public function getObj(float $timeout = null, int $beforeUseTryTimes = 3) $this->createdNum--; unset($this->objHash[$hash]); } + }else{ + $this->createdNum--; } //同样进入调度等待,理论上此处可以马上pop出来 $obj = $this->poolChannel->pop($timeout); @@ -226,6 +228,8 @@ public function keepMin(?int $num = null): int if (!$this->putObject($obj)) { $this->createdNum--; } + }else{ + $this->createdNum--; } }