wait_on_address.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 2020 Andrey Semashev
  3. *
  4. * Distributed under the Boost Software License, Version 1.0.
  5. * See http://www.boost.org/LICENSE_1_0.txt
  6. */
  7. #ifndef BOOST_WINAPI_WAIT_ON_ADDRESS_HPP_INCLUDED_
  8. #define BOOST_WINAPI_WAIT_ON_ADDRESS_HPP_INCLUDED_
  9. #include <boost/winapi/config.hpp>
  10. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
  11. #include <boost/winapi/basic_types.hpp>
  12. #include <boost/winapi/detail/header.hpp>
  13. #ifdef BOOST_HAS_PRAGMA_ONCE
  14. #pragma once
  15. #endif
  16. #if !defined(BOOST_USE_WINDOWS_H)
  17. extern "C" {
  18. // Note: These functions are not dllimport
  19. boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  20. WaitOnAddress(
  21. volatile boost::winapi::VOID_* addr,
  22. boost::winapi::PVOID_ compare_addr,
  23. boost::winapi::SIZE_T_ size,
  24. boost::winapi::DWORD_ timeout_ms);
  25. boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  26. WakeByAddressSingle(boost::winapi::PVOID_ addr);
  27. boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  28. WakeByAddressAll(boost::winapi::PVOID_ addr);
  29. } // extern "C"
  30. #endif // !defined(BOOST_USE_WINDOWS_H)
  31. namespace boost {
  32. namespace winapi {
  33. using ::WaitOnAddress;
  34. using ::WakeByAddressSingle;
  35. using ::WakeByAddressAll;
  36. }
  37. }
  38. #include <boost/winapi/detail/footer.hpp>
  39. #endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
  40. #endif // BOOST_WINAPI_WAIT_ON_ADDRESS_HPP_INCLUDED_