diff --git a/include/boost/math/quadrature/detail/exp_sinh_detail.hpp b/include/boost/math/quadrature/detail/exp_sinh_detail.hpp index 1b153701b..0304c6b05 100644 --- a/include/boost/math/quadrature/detail/exp_sinh_detail.hpp +++ b/include/boost/math/quadrature/detail/exp_sinh_detail.hpp @@ -10,10 +10,10 @@ #include #include #include +#include #include #include #include -#include namespace boost{ namespace math{ namespace quadrature { namespace detail{ @@ -81,7 +81,7 @@ private: void extend_refinements()const { #ifndef BOOST_MATH_NO_ATOMIC_INT - boost::detail::lightweight_mutex::scoped_lock guard(m_mutex); + std::lock_guard guard(m_mutex); #endif // // Check some other thread hasn't got here after we read the atomic variable, but before we got here: @@ -128,7 +128,7 @@ private: std::size_t m_max_refinements; #ifndef BOOST_MATH_NO_ATOMIC_INT mutable boost::math::detail::atomic_unsigned_type m_committed_refinements; - mutable boost::detail::lightweight_mutex m_mutex; + mutable std::mutex m_mutex; #else mutable unsigned m_committed_refinements; #endif diff --git a/include/boost/math/quadrature/detail/sinh_sinh_detail.hpp b/include/boost/math/quadrature/detail/sinh_sinh_detail.hpp index c49b722d2..98877e8d0 100644 --- a/include/boost/math/quadrature/detail/sinh_sinh_detail.hpp +++ b/include/boost/math/quadrature/detail/sinh_sinh_detail.hpp @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -84,7 +84,7 @@ private: void extend_refinements()const { #ifndef BOOST_MATH_NO_ATOMIC_INT - boost::detail::lightweight_mutex::scoped_lock guard(m_mutex); + std::lock_guard guard(m_mutex); #endif // // Check some other thread hasn't got here after we read the atomic variable, but before we got here: @@ -129,7 +129,7 @@ private: std::size_t m_max_refinements; #ifndef BOOST_MATH_NO_ATOMIC_INT mutable boost::math::detail::atomic_unsigned_type m_committed_refinements; - mutable boost::detail::lightweight_mutex m_mutex; + mutable std::mutex m_mutex; #else mutable unsigned m_committed_refinements; #endif diff --git a/include/boost/math/quadrature/detail/tanh_sinh_detail.hpp b/include/boost/math/quadrature/detail/tanh_sinh_detail.hpp index d208ec2c3..b9f437f50 100644 --- a/include/boost/math/quadrature/detail/tanh_sinh_detail.hpp +++ b/include/boost/math/quadrature/detail/tanh_sinh_detail.hpp @@ -9,9 +9,9 @@ #include #include -#include -#include #include +#include +#include #include #include @@ -99,7 +99,7 @@ private: void extend_refinements()const { #ifndef BOOST_MATH_NO_ATOMIC_INT - boost::detail::lightweight_mutex::scoped_lock guard(m_mutex); + std::lock_guard guard(m_mutex); #endif // // Check some other thread hasn't got here after we read the atomic variable, but before we got here: @@ -172,7 +172,7 @@ private: std::size_t m_max_refinements, m_inital_row_length; #ifndef BOOST_MATH_NO_ATOMIC_INT mutable boost::math::detail::atomic_unsigned_type m_committed_refinements; - mutable boost::detail::lightweight_mutex m_mutex; + mutable std::mutex m_mutex; #else mutable unsigned m_committed_refinements; #endif diff --git a/include/boost/math/special_functions/detail/bernoulli_details.hpp b/include/boost/math/special_functions/detail/bernoulli_details.hpp index 36af71418..f1c461506 100644 --- a/include/boost/math/special_functions/detail/bernoulli_details.hpp +++ b/include/boost/math/special_functions/detail/bernoulli_details.hpp @@ -8,13 +8,13 @@ #define BOOST_MATH_BERNOULLI_DETAIL_HPP #include -#include #include #include #include #include #include #include +#include namespace boost{ namespace math{ namespace detail{ // @@ -423,7 +423,7 @@ public: // // We need to grab a mutex every time we get here, for both readers and writers: // - boost::detail::lightweight_mutex::scoped_lock l(m_mutex); + std::lock_guard l(m_mutex); if(m_current_precision < boost::math::tools::digits()) { bn.clear(); @@ -453,7 +453,7 @@ public: if((static_cast(m_counter.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < start + n) || (static_cast(m_current_precision.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < boost::math::tools::digits())) { - boost::detail::lightweight_mutex::scoped_lock l(m_mutex); + std::lock_guard l(m_mutex); if((static_cast(m_counter.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < start + n) || (static_cast(m_current_precision.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < boost::math::tools::digits())) @@ -558,7 +558,7 @@ public: // // We need to grab a mutex every time we get here, for both readers and writers: // - boost::detail::lightweight_mutex::scoped_lock l(m_mutex); + std::lock_guard l(m_mutex); if(m_current_precision < boost::math::tools::digits()) { bn.clear(); @@ -596,7 +596,7 @@ public: if((static_cast(m_counter.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < start + n) || (static_cast(m_current_precision.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < boost::math::tools::digits())) { - boost::detail::lightweight_mutex::scoped_lock l(m_mutex); + std::lock_guard l(m_mutex); if((static_cast(m_counter.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < start + n) || (static_cast(m_current_precision.load(BOOST_MATH_ATOMIC_NS::memory_order_consume)) < boost::math::tools::digits())) @@ -649,10 +649,10 @@ private: #if !defined(BOOST_HAS_THREADS) int m_current_precision; #elif defined(BOOST_MATH_NO_ATOMIC_INT) - boost::detail::lightweight_mutex m_mutex; + std::mutex m_mutex; int m_current_precision; #else - boost::detail::lightweight_mutex m_mutex; + std::mutex m_mutex; atomic_counter_type m_counter, m_current_precision; #endif };