diff options
Diffstat (limited to '3rdParty/Boost/src/boost/smart_ptr/detail/yield_k.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/smart_ptr/detail/yield_k.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/yield_k.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/yield_k.hpp index 23eadd8..9f4496b 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/yield_k.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/yield_k.hpp @@ -11,6 +11,7 @@ // yield_k.hpp // // Copyright (c) 2008 Peter Dimov +// Copyright (c) Microsoft Corporation 2014 // // void yield( unsigned k ); // @@ -24,13 +25,17 @@ // #include <boost/config.hpp> +#include <boost/predef.h> + +#if BOOST_PLAT_WINDOWS_RUNTIME +#include <thread> +#endif // BOOST_SMT_PAUSE #if defined(_MSC_VER) && _MSC_VER >= 1310 && ( defined(_M_IX86) || defined(_M_X64) ) extern "C" void _mm_pause(); -#pragma intrinsic( _mm_pause ) #define BOOST_SMT_PAUSE _mm_pause(); @@ -54,7 +59,7 @@ namespace boost namespace detail { -#if !defined( BOOST_USE_WINDOWS_H ) +#if !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME extern "C" void __stdcall Sleep( unsigned long ms ); #endif @@ -69,6 +74,7 @@ inline void yield( unsigned k ) BOOST_SMT_PAUSE } #endif +#if !BOOST_PLAT_WINDOWS_RUNTIME else if( k < 32 ) { Sleep( 0 ); @@ -77,6 +83,13 @@ inline void yield( unsigned k ) { Sleep( 1 ); } +#else + else + { + // Sleep isn't supported on the Windows Runtime. + std::this_thread::yield(); + } +#endif } } // namespace detail |