MCPcopy Create free account
hub / github.com/boostorg/cobalt / co_main

Function co_main

example/spsc.cpp:129–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129cobalt::main co_main(int argc, char * argv[])
130{
131 awaitable_spsc_queue<int> queue{1024};
132 auto t = thr(queue);
133
134 // dummy consumer
135 for (auto val = co_await queue.read();
136 val >= 0;
137 val = co_await queue.read());
138
139 co_await t;
140 co_return 0;
141}

Callers

nothing calls this directly

Calls 2

thrFunction · 0.70
readMethod · 0.45

Tested by

no test coverage detected