diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-24 20:33:19 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-24 20:35:17 (GMT) |
commit | 332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch) | |
tree | dd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/thread/pthread/mutex.hpp | |
parent | 90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff) | |
download | swift-contrib-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip swift-contrib-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2 |
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/thread/pthread/mutex.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/thread/pthread/mutex.hpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/3rdParty/Boost/src/boost/thread/pthread/mutex.hpp b/3rdParty/Boost/src/boost/thread/pthread/mutex.hpp index 1f7f790..2a326d7 100644 --- a/3rdParty/Boost/src/boost/thread/pthread/mutex.hpp +++ b/3rdParty/Boost/src/boost/thread/pthread/mutex.hpp @@ -27,10 +27,11 @@ namespace boost { - class mutex: - boost::noncopyable + class mutex { private: + mutex(mutex const&); + mutex& operator=(mutex const&); pthread_mutex_t m; public: mutex() @@ -48,7 +49,11 @@ namespace boost 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 +64,11 @@ namespace boost 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; } @@ -75,10 +84,12 @@ namespace boost typedef mutex try_mutex; - class timed_mutex: - boost::noncopyable + class timed_mutex { private: + timed_mutex(timed_mutex const&); + timed_mutex& operator=(timed_mutex const&); + private: pthread_mutex_t m; #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK pthread_cond_t cond; |