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

Method Cancel

library/cpp/threading/future/async_semaphore.cpp:53–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void TAsyncSemaphore::Cancel() {
54 std::list<TPromise<TPtr>> promises;
55 with_lock(Lock_) {
56 Cancelled_ = true;
57 std::swap(Promises_, promises);
58 }
59 for (auto& p: promises) {
60 p.SetException(std::make_exception_ptr(TOperationCancelledException()));
61 }
62}
63
64TAsyncSemaphore::TAutoRelease::~TAutoRelease() {
65 if (Sem) {

Callers 1

Y_UNIT_TESTFunction · 0.45

Calls 3

make_exception_ptrFunction · 0.50
SetExceptionMethod · 0.45

Tested by

no test coverage detected