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

Method with_lock

util/thread/pool.cpp:463–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461
462 inline void Add(IObjectInQueue* obj) {
463 with_lock (Mutex_) {
464 while (Obj_ != nullptr) {
465 CondFree_.Wait(Mutex_);
466 }
467
468 if (Free_ == 0) {
469 AddThreadNoLock();
470 }
471
472 Obj_ = obj;
473
474 Y_ENSURE_EX(!AllDone_, TThreadPoolException() << TStringBuf("adding to a stopped queue"));
475 }
476
477 CondReady_.Signal();
478 }

Callers

nothing calls this directly

Calls 2

WaitMethod · 0.45

Tested by

no test coverage detected