diff --git a/include/boost/detail/atomic_count.hpp b/include/boost/detail/atomic_count.hpp index 6486755..d97fafa 100644 --- a/include/boost/detail/atomic_count.hpp +++ b/include/boost/detail/atomic_count.hpp @@ -72,6 +72,8 @@ // are called driven by smart_ptr interface... // +// Note: atomic_count_linux.hpp has been disabled by default; see the +// comments inside for more info. #include @@ -90,17 +92,12 @@ typedef long atomic_count; } #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) - -#include - -#elif defined(linux) || defined(__linux) || defined(__linux__) - -#include - +# include +//#elif defined(linux) || defined(__linux) || defined(__linux__) +#elif defined(BOOST_USE_ASM_ATOMIC_H) +# include #elif defined(BOOST_HAS_PTHREADS) - -#include - +# include #else // #warning Unrecognized platform, detail::atomic_count will not be thread safe diff --git a/include/boost/detail/atomic_count_linux.hpp b/include/boost/detail/atomic_count_linux.hpp index 8fd5346..1a69cec 100644 --- a/include/boost/detail/atomic_count_linux.hpp +++ b/include/boost/detail/atomic_count_linux.hpp @@ -13,7 +13,13 @@ // // -// On Linux, atomic.h is usually located in /usr/include/asm +// This implementation uses . This is a kernel header; +// using kernel headers in a user program may cause a number of problems, +// and not all flavors of Linux provide the atomic instructions. +// +// This file is only provided because the performance of this implementation +// is significantly higher than the pthreads version. Use at your own risk +// (by defining BOOST_USE_ASM_ATOMIC_H.) // #include diff --git a/include/boost/detail/lightweight_mutex.hpp b/include/boost/detail/lightweight_mutex.hpp index 69a3a6c..d199114 100644 --- a/include/boost/detail/lightweight_mutex.hpp +++ b/include/boost/detail/lightweight_mutex.hpp @@ -31,6 +31,9 @@ // * Never keep a lightweight_mutex locked for long periods. // +// Note: lwm_linux.hpp has been disabled by default; see the comments +// inside for more info. + #include @@ -38,7 +41,8 @@ # include #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # include -#elif defined(linux) || defined(__linux) || defined(__linux__) +//#elif defined(linux) || defined(__linux) || defined(__linux__) +#elif defined(BOOST_USE_ASM_ATOMIC_H) # include #elif defined(__sgi) # include diff --git a/include/boost/detail/lwm_linux.hpp b/include/boost/detail/lwm_linux.hpp index f502d60..c4b3b1d 100644 --- a/include/boost/detail/lwm_linux.hpp +++ b/include/boost/detail/lwm_linux.hpp @@ -16,6 +16,16 @@ // warranty, and with no claim as to its suitability for any purpose. // +// +// This implementation uses . This is a kernel header; +// using kernel headers in a user program may cause a number of problems, +// and not all flavors of Linux provide the atomic instructions. +// +// This file is only provided because the performance of this implementation +// is about 3.5 times higher than the pthreads version. Use at your own risk +// (by defining BOOST_USE_ASM_ATOMIC_H.) +// + #include #include