diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -20,12 +20,13 @@ int main(int argc, char **argv) { HTTP::Server httpd(io_service, tcp::endpoint(tcp::v6(), config::vm["audist.httpd_port"].as<int>())); + std::size_t num_threads = config::vm["audist.threads"].as<std::size_t>(); std::vector<boost::shared_ptr<boost::thread> > threads; - for(std::size_t i = 0; i < 10; i++) { + for(std::size_t i = 0; i < num_threads; i++) { boost::shared_ptr<boost::thread> thread(new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service))); threads.push_back(thread); } - for(std::size_t i = 0; i < 10; i++) { + for(std::size_t i = 0; i < num_threads; i++) { threads[i]->join(); } } catch(std::exception& e) { |