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