diff --git a/include/boost/smart_ptr/detail/yield_k.hpp b/include/boost/smart_ptr/detail/yield_k.hpp index f226d86..7f6c645 100644 --- a/include/boost/smart_ptr/detail/yield_k.hpp +++ b/include/boost/smart_ptr/detail/yield_k.hpp @@ -32,13 +32,13 @@ inline void yield( unsigned k ) // Experiments on Windows and Fedora 32 show that a single pause, // followed by an immediate sp_thread_sleep(), is best. - if( k == 0 ) + if( k & 1 ) { - boost::core::sp_thread_pause(); + boost::core::sp_thread_sleep(); } else { - boost::core::sp_thread_sleep(); + boost::core::sp_thread_pause(); } }