1 #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
2 #define BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
10 // boost/smart_ptr/detail/sp_thread_pause.hpp
12 // inline void bost::detail::sp_thread_pause();
14 // Emits a "pause" instruction.
16 // Copyright 2008, 2020 Peter Dimov
17 // Distributed under the Boost Software License, Version 1.0
18 // https://www.boost.org/LICENSE_1_0.txt
20 #if defined(_MSC_VER) && _MSC_VER >= 1310 && ( defined(_M_IX86) || defined(_M_X64) ) && !defined(__c2__)
22 extern "C" void _mm_pause();
24 #define BOOST_SP_PAUSE _mm_pause();
26 #elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
28 #define BOOST_SP_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" );
32 #define BOOST_SP_PAUSE
41 inline void sp_thread_pause()
51 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED