#ifndef BOOST_ASIO_DETAIL_STD_THREAD_HPP
#define BOOST_ASIO_DETAIL_STD_THREAD_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif
#include <boost/asio/detail/config.hpp>
#include <thread>
#include <boost/asio/detail/memory.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
namespace detail {
class std_thread
{
public:
std_thread() noexcept
: thread_()
{
}
template <typename Function>
std_thread(Function f, unsigned int = 0)
: thread_(f)
{
}
template <typename Allocator, typename Function>
std_thread(allocator_arg_t, const Allocator&, Function f, unsigned int = 0)
: thread_(f)
{
}
std_thread(std_thread&& other) noexcept
: thread_(static_cast<std::thread&&>(other.thread_))
{
}
~std_thread()
{
}
std_thread& operator=(std_thread&& other) noexcept
{
thread_ = static_cast<std::thread&&>(other.thread_);
return *this;
}
bool joinable() const
{
return thread_.joinable();
}
void join()
{
if (thread_.joinable())
thread_.join();
}
static std::size_t hardware_concurrency()
{
return std::thread::hardware_concurrency();
}
private:
std::thread thread_;
};
} } }
#include <boost/asio/detail/pop_options.hpp>
#endif