thread.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // detail/thread.hpp
  3. // ~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2023 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/config.hpp"
  16. #if !defined(ASIO_HAS_THREADS)
  17. # include "asio/detail/null_thread.hpp"
  18. #elif defined(ASIO_HAS_PTHREADS)
  19. # include "asio/detail/posix_thread.hpp"
  20. #elif defined(ASIO_WINDOWS)
  21. # if defined(UNDER_CE)
  22. # include "asio/detail/wince_thread.hpp"
  23. # elif defined(ASIO_WINDOWS_APP)
  24. # include "asio/detail/winapp_thread.hpp"
  25. # else
  26. # include "asio/detail/win_thread.hpp"
  27. # endif
  28. #else
  29. # include "asio/detail/std_thread.hpp"
  30. #endif
  31. namespace asio {
  32. namespace detail {
  33. #if !defined(ASIO_HAS_THREADS)
  34. typedef null_thread thread;
  35. #elif defined(ASIO_HAS_PTHREADS)
  36. typedef posix_thread thread;
  37. #elif defined(ASIO_WINDOWS)
  38. # if defined(UNDER_CE)
  39. typedef wince_thread thread;
  40. # elif defined(ASIO_WINDOWS_APP)
  41. typedef winapp_thread thread;
  42. # else
  43. typedef win_thread thread;
  44. # endif
  45. #else
  46. typedef std_thread thread;
  47. #endif
  48. } // namespace detail
  49. } // namespace asio
  50. #endif // ASIO_DETAIL_THREAD_HPP