|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57953 - trunk/boost/smart_ptr/detail
From: pdimov_at_[hidden]
Date: 2009-11-26 15:55:05
Author: pdimov
Date: 2009-11-26 15:55:05 EST (Thu, 26 Nov 2009)
New Revision: 57953
URL: http://svn.boost.org/trac/boost/changeset/57953
Log:
Add error checking to lwm_pthreads.hpp. Refs #2681.
Text files modified:
trunk/boost/smart_ptr/detail/lwm_pthreads.hpp | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
Modified: trunk/boost/smart_ptr/detail/lwm_pthreads.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/lwm_pthreads.hpp (original)
+++ trunk/boost/smart_ptr/detail/lwm_pthreads.hpp 2009-11-26 15:55:05 EST (Thu, 26 Nov 2009)
@@ -17,6 +17,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
+#include <boost/assert.hpp>
#include <pthread.h>
namespace boost
@@ -42,15 +43,15 @@
// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
#if defined(__hpux) && defined(_DECTHREADS_)
- pthread_mutex_init(&m_, pthread_mutexattr_default);
+ BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 );
#else
- pthread_mutex_init(&m_, 0);
+ BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 );
#endif
}
~lightweight_mutex()
{
- pthread_mutex_destroy(&m_);
+ BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 );
}
class scoped_lock;
@@ -69,12 +70,12 @@
scoped_lock(lightweight_mutex & m): m_(m.m_)
{
- pthread_mutex_lock(&m_);
+ BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
}
~scoped_lock()
{
- pthread_mutex_unlock(&m_);
+ BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
}
};
};
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