Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
18
int 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
add
Function · 0.85
start
Method · 0.80
join
Method · 0.80
co_spawn
Method · 0.45
Tested by
no test coverage detected