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