|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85302 - trunk/boost/flyweight/detail
From: joaquin_at_[hidden]
Date: 2013-08-11 11:27:10
Author: joaquin
Date: 2013-08-11 11:27:10 EDT (Sun, 11 Aug 2013)
New Revision: 85302
URL: http://svn.boost.org/trac/boost/changeset/85302
Log:
fixed #8914
Text files modified:
trunk/boost/flyweight/detail/recursive_lw_mutex.hpp | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
Modified: trunk/boost/flyweight/detail/recursive_lw_mutex.hpp
==============================================================================
--- trunk/boost/flyweight/detail/recursive_lw_mutex.hpp Sun Aug 11 07:37:37 2013 (r85301)
+++ trunk/boost/flyweight/detail/recursive_lw_mutex.hpp 2013-08-11 11:27:10 EDT (Sun, 11 Aug 2013) (r85302)
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 Joaquin M Lopez Munoz.
+/* Copyright 2006-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -39,6 +39,7 @@
#else
/* code shamelessly ripped from <boost/detail/lwm_pthreads.hpp> */
+#include <boost/assert.hpp>
#include <boost/noncopyable.hpp>
#include <pthread.h>
@@ -53,10 +54,10 @@
recursive_lightweight_mutex()
{
pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&m_,&attr);
- pthread_mutexattr_destroy(&attr);
+ BOOST_VERIFY(pthread_mutexattr_init(&attr)==0);
+ BOOST_VERIFY(pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE)==0);
+ BOOST_VERIFY(pthread_mutex_init(&m_,&attr)==0);
+ BOOST_VERIFY(pthread_mutexattr_destroy(&attr)==0);
}
~recursive_lightweight_mutex(){pthread_mutex_destroy(&m_);}
@@ -68,10 +69,10 @@
public:
scoped_lock(recursive_lightweight_mutex& m):m_(m.m_)
{
- pthread_mutex_lock(&m_);
+ BOOST_VERIFY(pthread_mutex_lock(&m_)==0);
}
- ~scoped_lock(){pthread_mutex_unlock(&m_);}
+ ~scoped_lock(){BOOST_VERIFY(pthread_mutex_unlock(&m_)==0);}
private:
pthread_mutex_t& m_;
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