MCPcopy Create free account
hub / github.com/boostorg/asio / run

Method run

example/cpp11/http/server2/io_context_pool.cpp:34–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void io_context_pool::run()
35{
36 // Create a pool of threads to run all of the io_contexts.
37 std::vector<std::thread> threads;
38 for (std::size_t i = 0; i < io_contexts_.size(); ++i)
39 threads.emplace_back([this, i]{ io_contexts_[i]->run(); });
40
41 // Wait for all threads in the pool to exit.
42 for (std::size_t i = 0; i < threads.size(); ++i)
43 threads[i].join();
44}
45
46void io_context_pool::stop()
47{

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected