]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/impl/system_context.ipp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / impl / system_context.ipp
index 36fadfbbf028d8a094697d85be956db18aa20f45..8eaba70b1fc05e7d17028c404a25ce9953630b1d 100644 (file)
@@ -29,8 +29,19 @@ struct system_context::thread_function
 
   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)
   }
 };
 
@@ -40,8 +51,9 @@ system_context::system_context()
   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()