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

Method visualize

example/sem_std.cpp:53–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

workerThreadFunction · 0.45

Calls 1

lock_guardClass · 0.85

Tested by

no test coverage detected