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

Function CoCondVarTest

library/cpp/coroutine/engine/coroutine_ut.cpp:304–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304static void CoCondVarTest(TCont* c, void* /*run*/) {
305 c->Executor()->Create(CoCondVar, nullptr, "1");
306 c->Yield();
307 c->Executor()->Create(CoCondVar, nullptr, "2");
308 c->Yield();
309 c->Executor()->Create(CoCondVar, nullptr, "3");
310 c->Yield();
311 c->Executor()->Create(CoCondVar, nullptr, "4");
312 c->Yield();
313 c->Executor()->Create(CoCondVar, nullptr, "5");
314 c->Yield();
315 c->Executor()->Create(CoCondVar, nullptr, "6");
316 c->Yield();
317
318 for (size_t i5 = 0; i5 < 3; ++i5) {
319 res += ToString((size_t)i5) + "^";
320 c1.BroadCast();
321 c->Yield();
322 }
323}
324
325void TCoroTest::TestCondVar() {
326 TContExecutor e(32000);

Callers

nothing calls this directly

Calls 5

YieldMethod · 0.80
ToStringFunction · 0.50
CreateMethod · 0.45
ExecutorMethod · 0.45
BroadCastMethod · 0.45

Tested by

no test coverage detected