summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-24 20:33:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-24 20:35:17 (GMT)
commit332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch)
treedd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp
parent90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff)
downloadswift-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip
swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp')
-rw-r--r--3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp b/3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp
index 2407f91..cdbf8c6 100644
--- a/3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp
+++ b/3rdParty/Boost/src/boost/thread/pthread/pthread_mutex_scoped_lock.hpp
@@ -18,15 +18,25 @@ namespace boost
class pthread_mutex_scoped_lock
{
pthread_mutex_t* m;
+ bool locked;
public:
explicit pthread_mutex_scoped_lock(pthread_mutex_t* m_):
- m(m_)
+ m(m_),locked(true)
{
BOOST_VERIFY(!pthread_mutex_lock(m));
}
- ~pthread_mutex_scoped_lock()
+ void unlock()
{
BOOST_VERIFY(!pthread_mutex_unlock(m));
+ locked=false;
+ }
+
+ ~pthread_mutex_scoped_lock()
+ {
+ if(locked)
+ {
+ unlock();
+ }
}
};