diff options
Diffstat (limited to '3rdParty/Boost/src/boost/thread/locks.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/thread/locks.hpp | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/3rdParty/Boost/src/boost/thread/locks.hpp b/3rdParty/Boost/src/boost/thread/locks.hpp index 82394a5..3cd6f28 100644 --- a/3rdParty/Boost/src/boost/thread/locks.hpp +++ b/3rdParty/Boost/src/boost/thread/locks.hpp @@ -248,7 +248,7 @@ namespace boost { timed_lock(target_time); } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES unique_lock(unique_lock&& other): m(other.m),is_locked(other.is_locked) { @@ -321,17 +321,17 @@ namespace boost swap(temp); return *this; } - void swap(unique_lock& other) - { - std::swap(m,other.m); - std::swap(is_locked,other.is_locked); - } void swap(detail::thread_move_t<unique_lock<Mutex> > other) { std::swap(m,other->m); std::swap(is_locked,other->is_locked); } #endif + void swap(unique_lock& other) + { + std::swap(m,other.m); + std::swap(is_locked,other.is_locked); + } ~unique_lock() { @@ -344,7 +344,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->lock(); is_locked=true; @@ -353,7 +353,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->try_lock(); return is_locked; @@ -379,7 +379,7 @@ namespace boost { if(!owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->unlock(); is_locked=false; @@ -416,25 +416,30 @@ namespace boost friend class upgrade_lock<Mutex>; }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template<typename Mutex> void swap(unique_lock<Mutex>&& lhs,unique_lock<Mutex>&& rhs) { lhs.swap(rhs); } -#else +#endif template<typename Mutex> void swap(unique_lock<Mutex>& lhs,unique_lock<Mutex>& rhs) { lhs.swap(rhs); } -#endif -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template<typename Mutex> inline unique_lock<Mutex>&& move(unique_lock<Mutex>&& ul) { - return ul; + return static_cast<unique_lock<Mutex>&&>(ul); + } + + template<typename Mutex> + inline unique_lock<Mutex>&& move(unique_lock<Mutex>& ul) + { + return static_cast<unique_lock<Mutex>&&>(ul); } #endif @@ -535,24 +540,24 @@ namespace boost return *this; } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES void swap(shared_lock&& other) { std::swap(m,other.m); std::swap(is_locked,other.is_locked); } #else - void swap(shared_lock& other) - { - std::swap(m,other.m); - std::swap(is_locked,other.is_locked); - } void swap(boost::detail::thread_move_t<shared_lock<Mutex> > other) { std::swap(m,other->m); std::swap(is_locked,other->is_locked); } #endif + void swap(shared_lock& other) + { + std::swap(m,other.m); + std::swap(is_locked,other.is_locked); + } Mutex* mutex() const { @@ -570,7 +575,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->lock_shared(); is_locked=true; @@ -579,7 +584,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->try_lock_shared(); return is_locked; @@ -588,7 +593,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->timed_lock_shared(target_time); return is_locked; @@ -598,7 +603,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->timed_lock_shared(target_time); return is_locked; @@ -607,7 +612,7 @@ namespace boost { if(!owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->unlock_shared(); is_locked=false; @@ -629,7 +634,7 @@ namespace boost }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template<typename Mutex> void swap(shared_lock<Mutex>&& lhs,shared_lock<Mutex>&& rhs) { @@ -733,7 +738,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->lock_upgrade(); is_locked=true; @@ -742,7 +747,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->try_lock_upgrade(); return is_locked; @@ -751,7 +756,7 @@ namespace boost { if(!owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->unlock_upgrade(); is_locked=false; @@ -775,7 +780,7 @@ namespace boost }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template<typename Mutex> unique_lock<Mutex>::unique_lock(upgrade_lock<Mutex>&& other): m(other.m),is_locked(other.is_locked) @@ -875,7 +880,7 @@ namespace boost try_lock_wrapper(Mutex& m_,try_to_lock_t): base(m_,try_to_lock) {} -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES try_lock_wrapper(try_lock_wrapper&& other): base(other.move()) {} @@ -963,7 +968,7 @@ namespace boost } }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template<typename Mutex> void swap(try_lock_wrapper<Mutex>&& lhs,try_lock_wrapper<Mutex>&& rhs) { |