| 46 | |
| 47 | |
| 48 | bool TElasticQueue::Add(IObjectInQueue* obj) { |
| 49 | if (!TryIncCounter()) { |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | THolder<TDecrementingWrapper> wrapper; |
| 54 | try { |
| 55 | wrapper.Reset(new TDecrementingWrapper(obj, this)); |
| 56 | } catch (...) { |
| 57 | AtomicDecrement(GuardCount_); |
| 58 | throw; |
| 59 | } |
| 60 | |
| 61 | if (SlaveQueue_->Add(wrapper.Get())) { |
| 62 | Y_UNUSED(wrapper.Release()); |
| 63 | return true; |
| 64 | } else { |
| 65 | return false; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | void TElasticQueue::Start(size_t threadCount, size_t maxQueueSize) { |
| 70 | MaxQueueSize_ = maxQueueSize; |
nothing calls this directly
no test coverage detected