Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85531 - trunk/boost/atomic/detail
From: andrey.semashev_at_[hidden]
Date: 2013-08-31 07:21:51


Author: andysem
Date: 2013-08-31 07:21:50 EDT (Sat, 31 Aug 2013)
New Revision: 85531
URL: http://svn.boost.org/trac/boost/changeset/85531

Log:
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.

Text files modified:
   trunk/boost/atomic/detail/lockpool.hpp | 18 ++++++------------
   1 files changed, 6 insertions(+), 12 deletions(-)

Modified: trunk/boost/atomic/detail/lockpool.hpp
==============================================================================
--- trunk/boost/atomic/detail/lockpool.hpp Fri Aug 30 13:51:03 2013 (r85530)
+++ trunk/boost/atomic/detail/lockpool.hpp 2013-08-31 07:21:50 EDT (Sat, 31 Aug 2013) (r85531)
@@ -9,7 +9,7 @@
 
 #include <boost/atomic/detail/config.hpp>
 #ifndef BOOST_ATOMIC_FLAG_LOCK_FREE
-#include <boost/thread/mutex.hpp>
+#include <boost/smart_ptr/detail/lightweight_mutex.hpp>
 #endif
 
 #ifdef BOOST_HAS_PRAGMA_ONCE
@@ -25,21 +25,15 @@
 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))
- {
- mtx_.lock();
- }
- ~scoped_lock()
+ explicit scoped_lock(const volatile void * addr) : base_type(get_lock_for(addr))
         {
- mtx_.unlock();
         }
 
         BOOST_DELETED_FUNCTION(scoped_lock(scoped_lock const&))


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk