Add noexcept to yield primitives

This commit is contained in:
Peter Dimov 2023-06-02 04:27:12 +03:00
parent 23ef6d3531
commit 0e71b6158d
3 changed files with 9 additions and 7 deletions

View File

@ -17,6 +17,8 @@
// Distributed under the Boost Software License, Version 1.0
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/config.hpp>
#if defined(__has_builtin)
# if __has_builtin(__builtin_ia32_pause) && !defined(_INTEL_COMPILER)
# define BOOST_CORE_HAS_BUILTIN_IA32_PAUSE
@ -56,7 +58,7 @@ namespace boost
namespace core
{
inline void sp_thread_pause()
BOOST_FORCEINLINE void sp_thread_pause() BOOST_NOEXCEPT
{
BOOST_CORE_SP_PAUSE();
}

View File

@ -36,7 +36,7 @@ namespace core
namespace detail
{
inline void sp_thread_sleep()
inline void sp_thread_sleep() BOOST_NOEXCEPT
{
Sleep( 1 );
}
@ -65,7 +65,7 @@ namespace boost
namespace core
{
inline void sp_thread_sleep()
inline void sp_thread_sleep() BOOST_NOEXCEPT
{
#if defined(BOOST_HAS_PTHREADS)
@ -109,7 +109,7 @@ namespace boost
namespace core
{
inline void sp_thread_sleep()
inline void sp_thread_sleep() BOOST_NOEXCEPT
{
sp_thread_yield();
}

View File

@ -36,7 +36,7 @@ namespace core
namespace detail
{
inline void sp_thread_yield()
inline void sp_thread_yield() BOOST_NOEXCEPT
{
Sleep( 0 );
}
@ -66,7 +66,7 @@ namespace boost
namespace core
{
inline void sp_thread_yield()
inline void sp_thread_yield() BOOST_NOEXCEPT
{
sched_yield();
}
@ -87,7 +87,7 @@ namespace boost
namespace core
{
inline void sp_thread_yield()
inline void sp_thread_yield() BOOST_NOEXCEPT
{
sp_thread_pause();
}