void operator()()
{
- boost::system::error_code ec;
- scheduler_->run(ec);
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
+ try
+ {
+#endif// !defined(BOOST_ASIO_NO_EXCEPTIONS)
+ boost::system::error_code ec;
+ scheduler_->run(ec);
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
+ }
+ catch (...)
+ {
+ std::terminate();
+ }
+#endif// !defined(BOOST_ASIO_NO_EXCEPTIONS)
}
};
scheduler_.work_started();
thread_function f = { &scheduler_ };
- std::size_t num_threads = detail::thread::hardware_concurrency() * 2;
- threads_.create_threads(f, num_threads ? num_threads : 2);
+ num_threads_ = detail::thread::hardware_concurrency() * 2;
+ num_threads_ = num_threads_ ? num_threads_ : 2;
+ threads_.create_threads(f, num_threads_);
}
system_context::~system_context()