thread.hpp 1.4 KB

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