This commit is contained in:
2023-04-06 23:00:58 +08:00
parent b7bcdc2096
commit df76dcaa54
+3 -6
View File
@@ -106,13 +106,10 @@ class PoolItem
*/
public function pop(int $waite = 10): mixed
{
if (!$this->_items->isEmpty()) {
if ($this->_items->isEmpty()) {
return call_user_func($this->callback);
} else {
return $this->_items->pop();
}
if ($this->created > $this->maxCreated) {
return $this->_items->pop($waite);
}
$this->created += 1;
return call_user_func($this->callback);
}
}