Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85196 - trunk/libs/lockfree/test
From: tim_at_[hidden]
Date: 2013-08-03 05:08:32


Author: timblechmann
Date: 2013-08-03 05:08:32 EDT (Sat, 03 Aug 2013)
New Revision: 85196
URL: http://svn.boost.org/trac/boost/changeset/85196

Log:
lockfree: use lock_guard instead of the deprecated boost::mutex::scoped_lock

fixes #8838

Text files modified:
   trunk/libs/lockfree/test/test_helpers.hpp | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/libs/lockfree/test/test_helpers.hpp
==============================================================================
--- trunk/libs/lockfree/test/test_helpers.hpp Sat Aug 3 03:47:18 2013 (r85195)
+++ trunk/libs/lockfree/test/test_helpers.hpp 2013-08-03 05:08:32 EDT (Sat, 03 Aug 2013) (r85196)
@@ -38,7 +38,7 @@
     {
         std::size_t index = calc_index(id);
 
- boost::mutex::scoped_lock lock (ref_mutex[index]);
+ boost::lock_guard<boost::mutex> lock (ref_mutex[index]);
 
         std::pair<typename std::set<int_type>::iterator, bool> p;
         p = data[index].insert(id);
@@ -50,7 +50,7 @@
     {
         std::size_t index = calc_index(id);
 
- boost::mutex::scoped_lock lock (ref_mutex[index]);
+ boost::lock_guard<boost::mutex> lock (ref_mutex[index]);
 
         return data[index].find(id) != data[index].end();
     }
@@ -59,7 +59,7 @@
     {
         std::size_t index = calc_index(id);
 
- boost::mutex::scoped_lock lock (ref_mutex[index]);
+ boost::lock_guard<boost::mutex> lock (ref_mutex[index]);
 
         if (data[index].find(id) != data[index].end()) {
             data[index].erase(id);
@@ -74,7 +74,7 @@
     {
         std::size_t ret = 0;
         for (int i = 0; i != buckets; ++i) {
- boost::mutex::scoped_lock lock (ref_mutex[i]);
+ boost::lock_guard<boost::mutex> lock (ref_mutex[i]);
             ret += data[i].size();
         }
         return ret;


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