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

Method Release

library/cpp/threading/future/async_semaphore.cpp:36–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void TAsyncSemaphore::Release() {
37 TPromise<TPtr> promise;
38 with_lock(Lock_) {
39 if (Cancelled_) {
40 return;
41 }
42 if (Promises_.empty()) {
43 ++Count_;
44 return;
45 } else {
46 promise = Promises_.front();
47 Promises_.pop_front();
48 }
49 }
50 promise.SetValue(this);
51}
52
53void TAsyncSemaphore::Cancel() {
54 std::list<TPromise<TPtr>> promises;

Callers 3

Y_UNIT_TESTFunction · 0.45
~TAutoReleaseMethod · 0.45
DeferReleaseMethod · 0.45

Calls 1

SetValueMethod · 0.45

Tested by

no test coverage detected