thread.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // thread.hpp
  3. // ~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2008 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. #ifndef BOOST_ASIO_DETAIL_THREAD_HPP
  11. #define BOOST_ASIO_DETAIL_THREAD_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/push_options.hpp>
  16. #include <boost/asio/detail/push_options.hpp>
  17. #include <boost/config.hpp>
  18. #include <boost/asio/detail/pop_options.hpp>
  19. #if !defined(BOOST_HAS_THREADS)
  20. # include <boost/asio/detail/null_thread.hpp>
  21. #elif defined(BOOST_WINDOWS)
  22. # if defined(UNDER_CE)
  23. # include <boost/asio/detail/wince_thread.hpp>
  24. # else
  25. # include <boost/asio/detail/win_thread.hpp>
  26. # endif
  27. #elif defined(BOOST_HAS_PTHREADS)
  28. # include <boost/asio/detail/posix_thread.hpp>
  29. #else
  30. # error Only Windows and POSIX are supported!
  31. #endif
  32. namespace boost {
  33. namespace asio {
  34. namespace detail {
  35. #if !defined(BOOST_HAS_THREADS)
  36. typedef null_thread thread;
  37. #elif defined(BOOST_WINDOWS)
  38. # if defined(UNDER_CE)
  39. typedef wince_thread thread;
  40. # else
  41. typedef win_thread thread;
  42. # endif
  43. #elif defined(BOOST_HAS_PTHREADS)
  44. typedef posix_thread thread;
  45. #endif
  46. } // namespace detail
  47. } // namespace asio
  48. } // namespace boost
  49. #include <boost/asio/detail/pop_options.hpp>
  50. #endif // BOOST_ASIO_DETAIL_THREAD_HPP