diff --git a/include/boost/core/detail/sp_thread_yield.hpp b/include/boost/core/detail/sp_thread_yield.hpp index efe6ea0..25127e8 100644 --- a/include/boost/core/detail/sp_thread_yield.hpp +++ b/include/boost/core/detail/sp_thread_yield.hpp @@ -24,7 +24,7 @@ #if defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) #if defined(BOOST_SP_REPORT_IMPLEMENTATION) - BOOST_PRAGMA_MESSAGE("Using Sleep(0) in sp_thread_yield") + BOOST_PRAGMA_MESSAGE("Using SwitchToThread() in sp_thread_yield") #endif #include @@ -38,7 +38,7 @@ namespace detail inline void sp_thread_yield() BOOST_NOEXCEPT { - Sleep( 0 ); + SwitchToThread(); } } // namespace detail diff --git a/include/boost/core/detail/sp_win32_sleep.hpp b/include/boost/core/detail/sp_win32_sleep.hpp index df51292..adec53e 100644 --- a/include/boost/core/detail/sp_win32_sleep.hpp +++ b/include/boost/core/detail/sp_win32_sleep.hpp @@ -41,6 +41,8 @@ namespace detail extern "C" __declspec(dllimport) void BOOST_CORE_SP_STDCALL Sleep( unsigned long ms ); #endif +extern "C" __declspec(dllimport) int BOOST_CORE_SP_STDCALL SwitchToThread(); + #undef BOOST_CORE_SP_STDCALL #endif // !defined( BOOST_USE_WINDOWS_H )