| 366 | } |
| 367 | |
| 368 | bool TThreadPool::Add(IObjectInQueue* obj) { |
| 369 | Y_ENSURE_EX(Impl_.Get(), TThreadPoolException() << TStringBuf("mtp queue not started")); |
| 370 | |
| 371 | if (Impl_->NeedRestart()) { |
| 372 | Start(Impl_->GetThreadCountExpected(), Impl_->GetMaxQueueSize()); |
| 373 | } |
| 374 | |
| 375 | return Impl_->Add(obj); |
| 376 | } |
| 377 | |
| 378 | void TThreadPool::Start(size_t thrnum, size_t maxque) { |
| 379 | Impl_.Reset(new TImpl(this, thrnum, maxque, Params)); |
no test coverage detected