2 // detail/null_thread.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_DETAIL_NULL_THREAD_HPP
12 #define BOOST_ASIO_DETAIL_NULL_THREAD_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #if !defined(BOOST_ASIO_HAS_THREADS)
22 #include <boost/asio/detail/noncopyable.hpp>
23 #include <boost/asio/detail/throw_error.hpp>
24 #include <boost/asio/error.hpp>
26 #include <boost/asio/detail/push_options.hpp>
37 template <typename Function>
38 null_thread(Function, unsigned int = 0)
40 boost::asio::detail::throw_error(
41 boost::asio::error::operation_not_supported, "thread");
49 // Wait for the thread to exit.
54 // Get number of CPUs.
55 static std::size_t hardware_concurrency()
65 #include <boost/asio/detail/pop_options.hpp>
67 #endif // !defined(BOOST_ASIO_HAS_THREADS)
69 #endif // BOOST_ASIO_DETAIL_NULL_THREAD_HPP