MCPcopy Create free account
hub / github.com/baidu/babylon / main

Function main

example/use-with-bthread/example.cpp:9–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <vector>
8
9int main() {
10 ::babylon::CountDownLatch<::babylon::ButexInterface> latch(10);
11 auto future = latch.get_future();
12 for (size_t i = 0; i < 10; ++i) {
13 ::babylon::bthread_async([&, i]() {
14 BABYLON_LOG(INFO) << "finish " << i;
15 latch.count_down();
16 });
17 }
18 future.get();
19 BABYLON_LOG(INFO) << "finish all";
20 return 0;
21}

Callers 1

example.cppFile · 0.50

Calls 4

get_futureMethod · 0.80
count_downMethod · 0.80
bthread_asyncFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected