Mercurial > hg > vamp-build-and-test
diff DEPENDENCIES/generic/include/boost/interprocess/sync/detail/locks.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/interprocess/sync/detail/locks.hpp Fri Sep 04 12:01:02 2015 +0100 +++ b/DEPENDENCIES/generic/include/boost/interprocess/sync/detail/locks.hpp Mon Sep 07 11:12:49 2015 +0100 @@ -11,6 +11,14 @@ #ifndef BOOST_INTERPROCESS_DETAIL_LOCKS_HPP #define BOOST_INTERPROCESS_DETAIL_LOCKS_HPP +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> @@ -25,7 +33,7 @@ public: typedef typename Lock::mutex_type::internal_mutex_type mutex_type; - + internal_mutex_lock(Lock &l) : l_(l) @@ -57,6 +65,33 @@ void unlock() { l_.lock(); } }; +template <class Lock> +class lock_to_sharable +{ + Lock &l_; + + public: + explicit lock_to_sharable(Lock &l) + : l_(l) + {} + void lock() { l_.lock_sharable(); } + bool try_lock(){ return l_.try_lock_sharable(); } + void unlock() { l_.unlock_sharable(); } +}; + +template <class Lock> +class lock_to_wait +{ + Lock &l_; + + public: + explicit lock_to_wait(Lock &l) + : l_(l) + {} + void lock() { l_.wait(); } + bool try_lock(){ return l_.try_wait(); } +}; + } //namespace ipcdetail } //namespace interprocess } //namespace boost