thread.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2010 Vicente J. Botet Escriba
  3. * Copyright 2015 Andrey Semashev
  4. *
  5. * Distributed under the Boost Software License, Version 1.0.
  6. * See http://www.boost.org/LICENSE_1_0.txt
  7. */
  8. #ifndef BOOST_WINAPI_THREAD_HPP_INCLUDED_
  9. #define BOOST_WINAPI_THREAD_HPP_INCLUDED_
  10. #include <boost/winapi/basic_types.hpp>
  11. #include <boost/winapi/get_current_thread.hpp>
  12. #include <boost/winapi/get_current_thread_id.hpp>
  13. #ifdef BOOST_HAS_PRAGMA_ONCE
  14. #pragma once
  15. #endif
  16. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  17. #if !defined( BOOST_USE_WINDOWS_H )
  18. extern "C" {
  19. BOOST_SYMBOL_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  20. SleepEx(
  21. boost::winapi::DWORD_ dwMilliseconds,
  22. boost::winapi::BOOL_ bAlertable);
  23. BOOST_SYMBOL_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC Sleep(boost::winapi::DWORD_ dwMilliseconds);
  24. BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC SwitchToThread(BOOST_WINAPI_DETAIL_VOID);
  25. } // extern "C"
  26. #endif
  27. namespace boost {
  28. namespace winapi {
  29. using ::SleepEx;
  30. using ::Sleep;
  31. using ::SwitchToThread;
  32. }
  33. }
  34. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  35. #endif // BOOST_WINAPI_THREAD_HPP_INCLUDED_