1 | // |
2 | // detail/thread.hpp |
3 | // ~~~~~~~~~~~~~~~~~ |
4 | // |
5 | // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) |
6 | // |
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) |
9 | // |
10 | |
11 | #ifndef BOOST_ASIO_DETAIL_THREAD_HPP |
12 | #define BOOST_ASIO_DETAIL_THREAD_HPP |
13 | |
14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) |
15 | # pragma once |
16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) |
17 | |
18 | #include <boost/asio/detail/config.hpp> |
19 | |
20 | #if !defined(BOOST_ASIO_HAS_THREADS) |
21 | # include <boost/asio/detail/null_thread.hpp> |
22 | #elif defined(BOOST_ASIO_WINDOWS) |
23 | # if defined(BOOST_ASIO_WINDOWS_APP) || defined(UNDER_CE) |
24 | # include <boost/asio/detail/winapi_thread.hpp> |
25 | # else |
26 | # include <boost/asio/detail/win_thread.hpp> |
27 | # endif |
28 | #elif defined(BOOST_ASIO_HAS_PTHREADS) |
29 | # include <boost/asio/detail/posix_thread.hpp> |
30 | #elif defined(BOOST_ASIO_HAS_STD_THREAD) |
31 | # include <boost/asio/detail/std_thread.hpp> |
32 | #else |
33 | # error Only Windows, POSIX and std::thread are supported! |
34 | #endif |
35 | |
36 | namespace boost { |
37 | namespace asio { |
38 | namespace detail { |
39 | |
40 | #if !defined(BOOST_ASIO_HAS_THREADS) |
41 | typedef null_thread thread; |
42 | #elif defined(BOOST_ASIO_WINDOWS) |
43 | # if defined(BOOST_ASIO_WINDOWS_APP) || defined(UNDER_CE) |
44 | typedef winapi_thread thread; |
45 | # else |
46 | typedef win_thread thread; |
47 | # endif |
48 | #elif defined(BOOST_ASIO_HAS_PTHREADS) |
49 | typedef posix_thread thread; |
50 | #elif defined(BOOST_ASIO_HAS_STD_THREAD) |
51 | typedef std_thread thread; |
52 | #endif |
53 | |
54 | } // namespace detail |
55 | } // namespace asio |
56 | } // namespace boost |
57 | |
58 | #endif // BOOST_ASIO_DETAIL_THREAD_HPP |
59 | |