thread.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // thread.hpp --------------------------------------------------------------//
  2. // Copyright 2010 Vicente J. Botet Escriba
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. #ifndef BOOST_DETAIL_WINAPI_THREAD_HPP
  6. #define BOOST_DETAIL_WINAPI_THREAD_HPP
  7. #include <boost/detail/winapi/basic_types.hpp>
  8. #include <boost/detail/winapi/GetCurrentThread.hpp>
  9. #ifdef BOOST_HAS_PRAGMA_ONCE
  10. #pragma once
  11. #endif
  12. namespace boost
  13. {
  14. namespace detail
  15. {
  16. namespace winapi
  17. {
  18. #if defined( BOOST_USE_WINDOWS_H )
  19. using ::GetCurrentThreadId;
  20. using ::SleepEx;
  21. using ::Sleep;
  22. #else
  23. extern "C" {
  24. # ifndef UNDER_CE
  25. __declspec(dllimport) unsigned long __stdcall
  26. GetCurrentThreadId(void);
  27. __declspec(dllimport) unsigned long __stdcall
  28. SleepEx(unsigned long,int);
  29. __declspec(dllimport) void __stdcall
  30. Sleep(unsigned long);
  31. #else
  32. using ::GetCurrentThreadId;
  33. using ::SleepEx;
  34. using ::Sleep;
  35. #endif
  36. }
  37. #endif
  38. }
  39. }
  40. }
  41. #endif // BOOST_DETAIL_WINAPI_THREAD_HPP