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

Method Join

library/cpp/coroutine/engine/impl.cpp:44–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool TCont::Join(TCont* c, TInstant deadLine, std::function<void(TJoinWait&, TCont*)> forceStop) noexcept {
45 TJoinWait ev(*this);
46 c->Waiters_.PushBack(&ev);
47
48 do {
49 if (SleepD(deadLine) == ETIMEDOUT || Cancelled()) {
50 if (!ev.Empty()) {
51 if (forceStop) {
52 forceStop(ev, c);
53 } else {
54 c->Cancel();
55 }
56
57 do {
58 Switch();
59 } while (!ev.Empty());
60 }
61
62 return false;
63 }
64 } while (!ev.Empty());
65
66 return true;
67}
68
69int TCont::SleepD(TInstant deadline) noexcept {
70 TTimerEvent event(this, deadline);

Callers 15

~TIBMemPoolMethod · 0.45
~TUdpHttpMethod · 0.45
~TUdpHostMethod · 0.45
~TIBMemPoolMethod · 0.45
~TUdpHttpMethod · 0.45
operator()Method · 0.45
DoSubFunction · 0.45
DoMainFunction · 0.45
DoSubAFunction · 0.45
JoinListenerThreadsMethod · 0.45
~TThreadedResolverMethod · 0.45

Calls 3

PushBackMethod · 0.45
EmptyMethod · 0.45
CancelMethod · 0.45

Tested by 1