From b8cd09c50bb15b91af9d8214ca1febe30dd4fb6d Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 31 Aug 2013 11:21:50 +0000 Subject: [PATCH] Switched to boost::detail::lightweight_mutex instead of boost::mutex from Boost.Thread to avoid false dependencies on Boost.DateTime, Boost.Chrono and Boost.System. This should hopefully resolve linking problems on MinGW. [SVN r85531] --- include/boost/atomic/detail/lockpool.hpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/include/boost/atomic/detail/lockpool.hpp b/include/boost/atomic/detail/lockpool.hpp index c878926..ed2438b 100644 --- a/include/boost/atomic/detail/lockpool.hpp +++ b/include/boost/atomic/detail/lockpool.hpp @@ -9,7 +9,7 @@ #include #ifndef BOOST_ATOMIC_FLAG_LOCK_FREE -#include +#include #endif #ifdef BOOST_HAS_PRAGMA_ONCE @@ -25,21 +25,15 @@ namespace detail { class lockpool { public: - typedef mutex lock_type; - class scoped_lock + typedef boost::detail::lightweight_mutex lock_type; + class scoped_lock : + public lock_type::scoped_lock { - private: - lock_type& mtx_; + typedef lock_type::scoped_lock base_type; public: - explicit - scoped_lock(const volatile void * addr) : mtx_(get_lock_for(addr)) + explicit scoped_lock(const volatile void * addr) : base_type(get_lock_for(addr)) { - mtx_.lock(); - } - ~scoped_lock() - { - mtx_.unlock(); } BOOST_DELETED_FUNCTION(scoped_lock(scoped_lock const&))