|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62123 - trunk/boost/thread/pthread
From: anthony_at_[hidden]
Date: 2010-05-21 13:14:24
Author: anthonyw
Date: 2010-05-21 13:14:23 EDT (Fri, 21 May 2010)
New Revision: 62123
URL: http://svn.boost.org/trac/boost/changeset/62123
Log:
Fix for trac issue #3269
Text files modified:
trunk/boost/thread/pthread/mutex.hpp | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
Modified: trunk/boost/thread/pthread/mutex.hpp
==============================================================================
--- trunk/boost/thread/pthread/mutex.hpp (original)
+++ trunk/boost/thread/pthread/mutex.hpp 2010-05-21 13:14:23 EDT (Fri, 21 May 2010)
@@ -48,7 +48,11 @@
void lock()
{
- BOOST_VERIFY(!pthread_mutex_lock(&m));
+ int const res=pthread_mutex_lock(&m);
+ if(res)
+ {
+ boost::throw_exception(lock_error(res));
+ }
}
void unlock()
@@ -59,7 +63,11 @@
bool try_lock()
{
int const res=pthread_mutex_trylock(&m);
- BOOST_ASSERT(!res || res==EBUSY);
+ if(res && (res!=EBUSY))
+ {
+ boost::throw_exception(lock_error(res));
+ }
+
return !res;
}
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