MCPcopy Create free account
hub / github.com/Codesire-Deng/co_context / visualize

Method visualize

example/sem.cpp:56–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 task<void> visualize(unsigned id, unsigned x_scale = 2) const {
57 auto cout_n = [=](auto str, unsigned n) {
58 n *= x_scale;
59 while (n-- > 0) {
60 std::cout << str;
61 }
62 };
63 auto guard = co_await cout_mutex.lock_guard();
64 std::cout << "#" << std::setw(2) << id << " ";
65 cout_n("░", delay);
66 cout_n("▒", wait_on_sema);
67 cout_n("█", occupy);
68 std::cout << '\n';
69 }
70
71 static void show_info() {
72 std::cout

Callers 1

workerThreadFunction · 0.45

Calls 1

lock_guardMethod · 0.45

Tested by

no test coverage detected