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

Function main

example/mutex.cpp:18–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18int main() {
19 io_context ctx[10];
20 for (int i = 0; i < 1000; ++i) {
21 ctx[i % 10].co_spawn(add());
22 }
23 for (auto &c : ctx) {
24 c.start();
25 }
26
27 ctx[0].join(); // never stop
28 return 0;
29}

Callers

nothing calls this directly

Calls 4

addFunction · 0.85
startMethod · 0.80
joinMethod · 0.80
co_spawnMethod · 0.45

Tested by

no test coverage detected