| @@ 297-306 (lines=10) @@ | ||
| 294 | * @param mixed $inf Info |
|
| 295 | * @return void |
|
| 296 | */ |
|
| 297 | public function attach($conn, $inf = null) |
|
| 298 | { |
|
| 299 | parent::attach($conn, $inf); |
|
| 300 | if ($this->maxConcurrency && !$this->overload) { |
|
| 301 | if ($this->count() >= $this->maxConcurrency) { |
|
| 302 | $this->overload = true; |
|
| 303 | $this->disable(); |
|
| 304 | return; |
|
| 305 | } |
|
| 306 | } |
|
| 307 | } |
|
| 308 | ||
| 309 | /** |
|
| @@ 314-322 (lines=9) @@ | ||
| 311 | * @param object $conn Connection |
|
| 312 | * @return void |
|
| 313 | */ |
|
| 314 | public function detach($conn) |
|
| 315 | { |
|
| 316 | parent::detach($conn); |
|
| 317 | if ($this->overload) { |
|
| 318 | if (!$this->maxConcurrency || ($this->count() < $this->maxConcurrency)) { |
|
| 319 | $this->overload = false; |
|
| 320 | $this->enable(); |
|
| 321 | } |
|
| 322 | } |
|
| 323 | } |
|
| 324 | ||
| 325 | /** |
|