MCPcopy Create free account
hub / github.com/catboost/catboost / Add

Method Add

library/cpp/threading/equeue/equeue.cpp:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48bool 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
69void TElasticQueue::Start(size_t threadCount, size_t maxQueueSize) {
70 MaxQueueSize_ = maxQueueSize;

Callers

nothing calls this directly

Calls 5

Y_UNUSEDFunction · 0.85
AtomicDecrementFunction · 0.50
ResetMethod · 0.45
GetMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected