diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/interprocess | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2 boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/interprocess')
29 files changed, 236 insertions, 252 deletions
diff --git a/boost/interprocess/allocators/adaptive_pool.hpp b/boost/interprocess/allocators/adaptive_pool.hpp index 3c0d50f5ec..801a436648 100644 --- a/boost/interprocess/allocators/adaptive_pool.hpp +++ b/boost/interprocess/allocators/adaptive_pool.hpp @@ -102,7 +102,7 @@ class adaptive_pool_base typedef typename segment_manager::difference_type difference_type; typedef boost::interprocess::version_type<adaptive_pool_base, Version> version; - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; //!Obtains adaptive_pool_base from diff --git a/boost/interprocess/allocators/allocator.hpp b/boost/interprocess/allocators/allocator.hpp index 759e3d2605..9a5bf32631 100644 --- a/boost/interprocess/allocators/allocator.hpp +++ b/boost/interprocess/allocators/allocator.hpp @@ -109,7 +109,7 @@ class allocator #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) //Experimental. Don't use. - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED diff --git a/boost/interprocess/allocators/detail/adaptive_node_pool.hpp b/boost/interprocess/allocators/detail/adaptive_node_pool.hpp index 2996bc82ec..d2b0b366fc 100644 --- a/boost/interprocess/allocators/detail/adaptive_node_pool.hpp +++ b/boost/interprocess/allocators/detail/adaptive_node_pool.hpp @@ -48,13 +48,13 @@ template< class SegmentManager , unsigned char OverheadPercent > class private_adaptive_node_pool - : public boost::container::container_detail::private_adaptive_node_pool_impl + : public boost::container::dtl::private_adaptive_node_pool_impl < typename SegmentManager::segment_manager_base_type , ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered > { - typedef boost::container::container_detail::private_adaptive_node_pool_impl + typedef boost::container::dtl::private_adaptive_node_pool_impl < typename SegmentManager::segment_manager_base_type , ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered diff --git a/boost/interprocess/allocators/detail/allocator_common.hpp b/boost/interprocess/allocators/detail/allocator_common.hpp index f613ffd822..7939404696 100644 --- a/boost/interprocess/allocators/detail/allocator_common.hpp +++ b/boost/interprocess/allocators/detail/allocator_common.hpp @@ -328,7 +328,7 @@ class array_allocation_impl <const value_type>::type const_reference; typedef typename SegmentManager::size_type size_type; typedef typename SegmentManager::difference_type difference_type; - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; @@ -442,7 +442,7 @@ class node_pool_allocation_impl <const value_type>::type const_reference; typedef typename SegmentManager::size_type size_type; typedef typename SegmentManager::difference_type difference_type; - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; diff --git a/boost/interprocess/allocators/detail/node_pool.hpp b/boost/interprocess/allocators/detail/node_pool.hpp index 9b2041f4e2..552410ad59 100644 --- a/boost/interprocess/allocators/detail/node_pool.hpp +++ b/boost/interprocess/allocators/detail/node_pool.hpp @@ -45,10 +45,10 @@ namespace ipcdetail { template< class SegmentManager, std::size_t NodeSize, std::size_t NodesPerBlock > class private_node_pool //Inherit from the implementation to avoid template bloat - : public boost::container::container_detail:: + : public boost::container::dtl:: private_node_pool_impl<typename SegmentManager::segment_manager_base_type> { - typedef boost::container::container_detail::private_node_pool_impl + typedef boost::container::dtl::private_node_pool_impl <typename SegmentManager::segment_manager_base_type> base_t; //Non-copyable private_node_pool(); diff --git a/boost/interprocess/allocators/node_allocator.hpp b/boost/interprocess/allocators/node_allocator.hpp index 8bd6dfe2c3..aa9931a59e 100644 --- a/boost/interprocess/allocators/node_allocator.hpp +++ b/boost/interprocess/allocators/node_allocator.hpp @@ -99,7 +99,7 @@ class node_allocator_base typedef typename segment_manager::difference_type difference_type; typedef boost::interprocess::version_type<node_allocator_base, Version> version; - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; //!Obtains node_allocator_base from diff --git a/boost/interprocess/allocators/private_adaptive_pool.hpp b/boost/interprocess/allocators/private_adaptive_pool.hpp index 89299299c3..3491c16401 100644 --- a/boost/interprocess/allocators/private_adaptive_pool.hpp +++ b/boost/interprocess/allocators/private_adaptive_pool.hpp @@ -100,7 +100,7 @@ class private_adaptive_pool_base typedef typename segment_manager::size_type difference_type; typedef boost::interprocess::version_type <private_adaptive_pool_base, Version> version; - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; //!Obtains node_allocator from other node_allocator diff --git a/boost/interprocess/allocators/private_node_allocator.hpp b/boost/interprocess/allocators/private_node_allocator.hpp index 24fb84c156..413e39c5cb 100644 --- a/boost/interprocess/allocators/private_node_allocator.hpp +++ b/boost/interprocess/allocators/private_node_allocator.hpp @@ -95,7 +95,7 @@ class private_node_allocator_base typedef typename segment_manager::difference_type difference_type; typedef boost::interprocess::version_type <private_node_allocator_base, Version> version; - typedef boost::container::container_detail::transform_multiallocation_chain + typedef boost::container::dtl::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; //!Obtains node_allocator from other node_allocator diff --git a/boost/interprocess/containers/pair.hpp b/boost/interprocess/containers/pair.hpp index a6e11f49d0..ccd3c235f0 100644 --- a/boost/interprocess/containers/pair.hpp +++ b/boost/interprocess/containers/pair.hpp @@ -26,7 +26,7 @@ namespace boost { namespace interprocess { -using boost::container::container_detail::pair; +using boost::container::dtl::pair; } //namespace interprocess { } //namespace boost { diff --git a/boost/interprocess/containers/version_type.hpp b/boost/interprocess/containers/version_type.hpp index 22b5eef4ff..6885072992 100644 --- a/boost/interprocess/containers/version_type.hpp +++ b/boost/interprocess/containers/version_type.hpp @@ -25,8 +25,8 @@ namespace boost { namespace interprocess { -using boost::container::container_detail::version_type; -using boost::container::container_detail::version; +using boost::container::dtl::version_type; +using boost::container::dtl::version; } //namespace interprocess { } //namespace boost { diff --git a/boost/interprocess/detail/atomic.hpp b/boost/interprocess/detail/atomic.hpp index e32f056c3d..041076cd65 100644 --- a/boost/interprocess/detail/atomic.hpp +++ b/boost/interprocess/detail/atomic.hpp @@ -570,6 +570,60 @@ inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val) } //namespace ipcdetail{ } //namespace interprocess{ } //namespace boost{ +#elif defined(__VXWORKS__) + +#include <vxAtomicLib.h> +// VxWorks atomic32_t is not volatile, for some unknown reason +#define vx_atomic_cast(_i) (reinterpret_cast< ::atomic32_t *>( const_cast<boost::uint32_t *>(_i))) + +namespace boost { +namespace interprocess { +namespace ipcdetail{ + +//! Atomically add 'val' to an boost::uint32_t +//! "mem": pointer to the object +//! "val": amount to add +//! Returns the old value pointed to by mem +inline boost::uint32_t atomic_add32 + (volatile boost::uint32_t *mem, boost::uint32_t val) +{ return ::vxAtomic32Add( vx_atomic_cast(mem), val); } + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline boost::uint32_t atomic_inc32(volatile boost::uint32_t *mem) +{ return ::vxAtomic32Inc( vx_atomic_cast(mem) ); } + +//! Atomically decrement an boost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline boost::uint32_t atomic_dec32(volatile boost::uint32_t *mem) +{ return ::vxAtomic32Dec( vx_atomic_cast(mem) ); } + +//! Atomically read an boost::uint32_t from memory +inline boost::uint32_t atomic_read32(volatile boost::uint32_t *mem) +{ return ::vxAtomic32Get( vx_atomic_cast(mem) ); } + +//! Compare an boost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline boost::uint32_t atomic_cas32 + (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t cmp) +{ return ::vxAtomic32Cas( vx_atomic_cast(mem), cmp, with); } + +//! Atomically set an boost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val) +{ ::vxAtomic32Set( vx_atomic_cast(mem), val); } + + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace boost{ #else diff --git a/boost/interprocess/detail/in_place_interface.hpp b/boost/interprocess/detail/in_place_interface.hpp index 013691ad78..367f9dca3d 100644 --- a/boost/interprocess/detail/in_place_interface.hpp +++ b/boost/interprocess/detail/in_place_interface.hpp @@ -51,7 +51,7 @@ template<class T> struct placement_destroy : public in_place_interface { placement_destroy() - : in_place_interface(::boost::container::container_detail::alignment_of<T>::value, sizeof(T), typeid(T).name()) + : in_place_interface(::boost::container::dtl::alignment_of<T>::value, sizeof(T), typeid(T).name()) {} virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed) diff --git a/boost/interprocess/detail/intermodule_singleton_common.hpp b/boost/interprocess/detail/intermodule_singleton_common.hpp index c890c326bc..392db1f86b 100644 --- a/boost/interprocess/detail/intermodule_singleton_common.hpp +++ b/boost/interprocess/detail/intermodule_singleton_common.hpp @@ -290,7 +290,7 @@ class intermodule_singleton_common static union mem_holder_t { unsigned char map_mem [sizeof(ThreadSafeGlobalMap)]; - ::boost::container::container_detail::max_align_t aligner; + ::boost::container::dtl::max_align_t aligner; } mem_holder; }; diff --git a/boost/interprocess/detail/managed_open_or_create_impl.hpp b/boost/interprocess/detail/managed_open_or_create_impl.hpp index 9351f391f9..b47c310f48 100644 --- a/boost/interprocess/detail/managed_open_or_create_impl.hpp +++ b/boost/interprocess/detail/managed_open_or_create_impl.hpp @@ -115,8 +115,8 @@ class managed_open_or_create_impl ct_rounded_size < sizeof(boost::uint32_t) , MemAlignment ? (MemAlignment) : - (::boost::container::container_detail::alignment_of - < ::boost::container::container_detail::max_align_t >::value) + (::boost::container::dtl::alignment_of + < ::boost::container::dtl::max_align_t >::value) >::value; managed_open_or_create_impl() diff --git a/boost/interprocess/detail/named_proxy.hpp b/boost/interprocess/detail/named_proxy.hpp index 4bec375b67..f3eb61d398 100644 --- a/boost/interprocess/detail/named_proxy.hpp +++ b/boost/interprocess/detail/named_proxy.hpp @@ -274,7 +274,7 @@ class named_proxy T *operator()( BOOST_MOVE_UREF##N ) const\ {\ typedef typename if_c<is_iterator \ - , CtorIt##N<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N> \ + , CtorIt##N <T BOOST_MOVE_I##N BOOST_MOVE_TARG##N> \ , CtorArg##N<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N> \ >::type ctor_obj_t;\ ctor_obj_t ctor_obj = ctor_obj_t( BOOST_MOVE_FWD##N );\ diff --git a/boost/interprocess/detail/os_thread_functions.hpp b/boost/interprocess/detail/os_thread_functions.hpp index 8a0a47cc27..1c48ecf58b 100644 --- a/boost/interprocess/detail/os_thread_functions.hpp +++ b/boost/interprocess/detail/os_thread_functions.hpp @@ -52,6 +52,9 @@ # include <sys/param.h> # include <sys/sysctl.h> # endif +#if defined(__VXWORKS__) +#include <vxCpuLib.h> +#endif //According to the article "C/C++ tip: How to measure elapsed real time for benchmarking" //Check MacOs first as macOS 10.12 SDK defines both CLOCK_MONOTONIC and //CLOCK_MONOTONIC_RAW and no clock_gettime. @@ -480,6 +483,18 @@ inline unsigned int get_num_cores() else{ return static_cast<unsigned int>(num_cores); } + #elif defined(__VXWORKS__) + cpuset_t set = ::vxCpuEnabledGet(); + #ifdef __DCC__ + int i; + for( i = 0; set; ++i) + { + set &= set -1; + } + return(i); + #else + return (__builtin_popcount(set) ); + #endif #endif } diff --git a/boost/interprocess/detail/segment_manager_helper.hpp b/boost/interprocess/detail/segment_manager_helper.hpp index cfa4bd2ba7..96ccf227fe 100644 --- a/boost/interprocess/detail/segment_manager_helper.hpp +++ b/boost/interprocess/detail/segment_manager_helper.hpp @@ -117,7 +117,7 @@ struct block_header { return get_rounded_size ( size_type(sizeof(Header)) - , size_type(::boost::container::container_detail::alignment_of<block_header<size_type> >::value)) + , size_type(::boost::container::dtl::alignment_of<block_header<size_type> >::value)) + total_size(); } @@ -169,7 +169,7 @@ struct block_header template<class T> static block_header<size_type> *block_header_from_value(T *value) - { return block_header_from_value(value, sizeof(T), ::boost::container::container_detail::alignment_of<T>::value); } + { return block_header_from_value(value, sizeof(T), ::boost::container::dtl::alignment_of<T>::value); } static block_header<size_type> *block_header_from_value(const void *value, std::size_t sz, std::size_t algn) { @@ -190,7 +190,7 @@ struct block_header block_header<size_type> * hdr = reinterpret_cast<block_header<size_type>*>(reinterpret_cast<char*>(header) + get_rounded_size( size_type(sizeof(Header)) - , size_type(::boost::container::container_detail::alignment_of<block_header<size_type> >::value))); + , size_type(::boost::container::dtl::alignment_of<block_header<size_type> >::value))); //Some sanity checks return hdr; } @@ -201,7 +201,7 @@ struct block_header Header * hdr = reinterpret_cast<Header*>(reinterpret_cast<char*>(bheader) - get_rounded_size( size_type(sizeof(Header)) - , size_type(::boost::container::container_detail::alignment_of<block_header<size_type> >::value))); + , size_type(::boost::container::dtl::alignment_of<block_header<size_type> >::value))); //Some sanity checks return hdr; } @@ -275,7 +275,7 @@ struct intrusive_value_type_impl intrusive_value_type_impl(){} - enum { BlockHdrAlignment = ::boost::container::container_detail::alignment_of<block_header<size_type> >::value }; + enum { BlockHdrAlignment = ::boost::container::dtl::alignment_of<block_header<size_type> >::value }; block_header<size_type> *get_block_header() const { diff --git a/boost/interprocess/detail/transform_iterator.hpp b/boost/interprocess/detail/transform_iterator.hpp index 1c4dcd3aeb..d409b52362 100644 --- a/boost/interprocess/detail/transform_iterator.hpp +++ b/boost/interprocess/detail/transform_iterator.hpp @@ -27,170 +27,14 @@ // interprocess #include <boost/interprocess/interprocess_fwd.hpp> -// interprocess/detail -#include <boost/interprocess/detail/type_traits.hpp> -// move/detail -#include <boost/container/detail/iterator.hpp> +// container/detail +#include <boost/container/detail/transform_iterator.hpp> namespace boost { namespace interprocess { -template <class PseudoReference> -struct operator_arrow_proxy -{ - operator_arrow_proxy(const PseudoReference &px) - : m_value(px) - {} - - PseudoReference* operator->() const { return &m_value; } - // This function is needed for MWCW and BCC, which won't call operator-> - // again automatically per 13.3.1.2 para 8 -// operator T*() const { return &m_value; } - mutable PseudoReference m_value; -}; - -template <class T> -struct operator_arrow_proxy<T&> -{ - operator_arrow_proxy(T &px) - : m_value(px) - {} - - T* operator->() const { return const_cast<T*>(&m_value); } - // This function is needed for MWCW and BCC, which won't call operator-> - // again automatically per 13.3.1.2 para 8 -// operator T*() const { return &m_value; } - T &m_value; -}; - -template <class Iterator, class UnaryFunction> -class transform_iterator - : public UnaryFunction -{ - public: - typedef typename ::boost::container::iterator_traits<Iterator>::iterator_category iterator_category; - typedef typename ipcdetail::remove_reference<typename UnaryFunction::result_type>::type value_type; - typedef typename ::boost::container::iterator_traits<Iterator>::difference_type difference_type; - typedef operator_arrow_proxy<typename UnaryFunction::result_type> pointer; - typedef typename UnaryFunction::result_type reference; - - explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction()) - : UnaryFunction(f), m_it(it) - {} - - explicit transform_iterator() - : UnaryFunction(), m_it() - {} - - //Constructors - transform_iterator& operator++() - { increment(); return *this; } - - transform_iterator operator++(int) - { - transform_iterator result (*this); - increment(); - return result; - } - - transform_iterator& operator--() - { decrement(); return *this; } - - transform_iterator operator--(int) - { - transform_iterator result (*this); - decrement(); - return result; - } - - friend bool operator== (const transform_iterator& i, const transform_iterator& i2) - { return i.equal(i2); } - - friend bool operator!= (const transform_iterator& i, const transform_iterator& i2) - { return !(i == i2); } - - friend bool operator< (const transform_iterator& i, const transform_iterator& i2) - { return i < i2; } - - friend bool operator> (const transform_iterator& i, const transform_iterator& i2) - { return i2 < i; } - - friend bool operator<= (const transform_iterator& i, const transform_iterator& i2) - { return !(i > i2); } - - friend bool operator>= (const transform_iterator& i, const transform_iterator& i2) - { return !(i < i2); } - - friend difference_type operator- (const transform_iterator& i, const transform_iterator& i2) - { return i2.distance_to(i); } - - //Arithmetic - transform_iterator& operator+=(difference_type off) - { this->advance(off); return *this; } - - transform_iterator operator+(difference_type off) const - { - transform_iterator other(*this); - other.advance(off); - return other; - } - - friend transform_iterator operator+(difference_type off, const transform_iterator& right) - { return right + off; } - - transform_iterator& operator-=(difference_type off) - { this->advance(-off); return *this; } - - transform_iterator operator-(difference_type off) const - { return *this + (-off); } - - typename UnaryFunction::result_type operator*() const - { return dereference(); } - - typename UnaryFunction::result_type operator[](difference_type off) const - { return UnaryFunction::operator()(m_it[off]); } - - operator_arrow_proxy<typename UnaryFunction::result_type> - operator->() const - { return operator_arrow_proxy<typename UnaryFunction::result_type>(dereference()); } - - Iterator & base() - { return m_it; } - - const Iterator & base() const - { return m_it; } - - private: - Iterator m_it; - - void increment() - { ++m_it; } - - void decrement() - { --m_it; } - - bool equal(const transform_iterator &other) const - { return m_it == other.m_it; } - - bool less(const transform_iterator &other) const - { return other.m_it < m_it; } - - typename UnaryFunction::result_type dereference() const - { return UnaryFunction::operator()(*m_it); } - - void advance(difference_type n) - { ::boost::container::iterator_advance(m_it, n); } - - difference_type distance_to(const transform_iterator &other)const - { return ::boost::container::iterator_distance(other.m_it, m_it); } -}; - -template <class Iterator, class UnaryFunc> -transform_iterator<Iterator, UnaryFunc> -make_transform_iterator(Iterator it, UnaryFunc fun) -{ - return transform_iterator<Iterator, UnaryFunc>(it, fun); -} +using boost::container::make_transform_iterator; +using boost::container::transform_iterator; } //namespace interprocess { } //namespace boost { diff --git a/boost/interprocess/detail/variadic_templates_tools.hpp b/boost/interprocess/detail/variadic_templates_tools.hpp index c0f591312b..936f702bc2 100644 --- a/boost/interprocess/detail/variadic_templates_tools.hpp +++ b/boost/interprocess/detail/variadic_templates_tools.hpp @@ -25,10 +25,10 @@ namespace boost { namespace interprocess { namespace ipcdetail { -using boost::container::container_detail::tuple; -using boost::container::container_detail::build_number_seq; -using boost::container::container_detail::index_tuple; -using boost::container::container_detail::get; +using boost::container::dtl::tuple; +using boost::container::dtl::build_number_seq; +using boost::container::dtl::index_tuple; +using boost::container::dtl::get; }}} //namespace boost { namespace interprocess { namespace ipcdetail { diff --git a/boost/interprocess/detail/win32_api.hpp b/boost/interprocess/detail/win32_api.hpp index 1ea8cec53d..d12097f512 100644 --- a/boost/interprocess/detail/win32_api.hpp +++ b/boost/interprocess/detail/win32_api.hpp @@ -2035,7 +2035,7 @@ inline bool get_registry_value_string(hkey key_type, const char *subkey_name, co unsigned long size; unsigned long type; long err = reg_query_value_ex( key, value_name, 0, &type, 0, &size); - if((reg_sz == type || reg_expand_sz != type) && !err){ + if((reg_sz == type || reg_expand_sz == type) && !err){ //Size includes terminating NULL s.resize(size); err = reg_query_value_ex( key, value_name, 0, &type, (unsigned char*)(&s[0]), &size); diff --git a/boost/interprocess/detail/workaround.hpp b/boost/interprocess/detail/workaround.hpp index bdee15a031..53cd3eb2c4 100644 --- a/boost/interprocess/detail/workaround.hpp +++ b/boost/interprocess/detail/workaround.hpp @@ -31,7 +31,7 @@ ////////////////////////////////////////////////////// //Check for XSI shared memory objects. They are available in nearly all UNIX platforms ////////////////////////////////////////////////////// - #if !defined(__QNXNTO__) && !defined(__ANDROID__) && !defined(__HAIKU__) + #if !defined(__QNXNTO__) && !defined(__ANDROID__) && !defined(__HAIKU__) && !(__VXWORKS__) #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS #endif diff --git a/boost/interprocess/ipc/message_queue.hpp b/boost/interprocess/ipc/message_queue.hpp index db422cc9d3..da45ad4807 100644 --- a/boost/interprocess/ipc/message_queue.hpp +++ b/boost/interprocess/ipc/message_queue.hpp @@ -74,7 +74,7 @@ class message_queue_t pointer_traits<void_pointer>::template rebind_pointer<char>::type char_ptr; typedef typename boost::intrusive::pointer_traits<char_ptr>::difference_type difference_type; - typedef typename boost::container::container_detail::make_unsigned<difference_type>::type size_type; + typedef typename boost::container::dtl::make_unsigned<difference_type>::type size_type; //!Creates a process shared message queue with name "name". For this message queue, //!the maximum number of messages will be "max_num_msg" and the maximum message size @@ -211,7 +211,7 @@ class msg_hdr_t pointer_traits<void_pointer>::template rebind_pointer<char>::type char_ptr; typedef typename boost::intrusive::pointer_traits<char_ptr>::difference_type difference_type; - typedef typename boost::container::container_detail::make_unsigned<difference_type>::type size_type; + typedef typename boost::container::dtl::make_unsigned<difference_type>::type size_type; public: size_type len; // Message length @@ -297,7 +297,7 @@ class mq_hdr_t typedef typename boost::intrusive::pointer_traits <msg_hdr_ptr_t>::difference_type difference_type; typedef typename boost::container:: - container_detail::make_unsigned<difference_type>::type size_type; + dtl::make_unsigned<difference_type>::type size_type; typedef typename boost::intrusive:: pointer_traits<void_pointer>::template rebind_pointer<msg_hdr_ptr_t>::type msg_hdr_ptr_ptr_t; @@ -529,8 +529,8 @@ class mq_hdr_t (size_type max_msg_size, size_type max_num_msg) { const size_type - msg_hdr_align = ::boost::container::container_detail::alignment_of<msg_header>::value, - index_align = ::boost::container::container_detail::alignment_of<msg_hdr_ptr_t>::value, + msg_hdr_align = ::boost::container::dtl::alignment_of<msg_header>::value, + index_align = ::boost::container::dtl::alignment_of<msg_hdr_ptr_t>::value, r_hdr_size = ipcdetail::ct_rounded_size<sizeof(mq_hdr_t), index_align>::value, r_index_size = ipcdetail::get_rounded_size<size_type>(max_num_msg*sizeof(msg_hdr_ptr_t), msg_hdr_align), r_max_msg_size = ipcdetail::get_rounded_size<size_type>(max_msg_size, msg_hdr_align) + sizeof(msg_header); @@ -543,8 +543,8 @@ class mq_hdr_t void initialize_memory() { const size_type - msg_hdr_align = ::boost::container::container_detail::alignment_of<msg_header>::value, - index_align = ::boost::container::container_detail::alignment_of<msg_hdr_ptr_t>::value, + msg_hdr_align = ::boost::container::dtl::alignment_of<msg_header>::value, + index_align = ::boost::container::dtl::alignment_of<msg_hdr_ptr_t>::value, r_hdr_size = ipcdetail::ct_rounded_size<sizeof(mq_hdr_t), index_align>::value, r_index_size = ipcdetail::get_rounded_size<size_type>(m_max_num_msg*sizeof(msg_hdr_ptr_t), msg_hdr_align), r_max_msg_size = ipcdetail::get_rounded_size<size_type>(m_max_msg_size, msg_hdr_align) + sizeof(msg_header); @@ -603,7 +603,7 @@ class msg_queue_initialization_func_t rebind_pointer<char>::type char_ptr; typedef typename boost::intrusive::pointer_traits<char_ptr>:: difference_type difference_type; - typedef typename boost::container::container_detail:: + typedef typename boost::container::dtl:: make_unsigned<difference_type>::type size_type; msg_queue_initialization_func_t(size_type maxmsg = 0, diff --git a/boost/interprocess/mem_algo/detail/mem_algo_common.hpp b/boost/interprocess/mem_algo/detail/mem_algo_common.hpp index 87293d18fa..eda4cf1be3 100644 --- a/boost/interprocess/mem_algo/detail/mem_algo_common.hpp +++ b/boost/interprocess/mem_algo/detail/mem_algo_common.hpp @@ -48,11 +48,11 @@ namespace ipcdetail { template<class VoidPointer> class basic_multiallocation_chain - : public boost::container::container_detail:: + : public boost::container::dtl:: basic_multiallocation_chain<VoidPointer> { BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_multiallocation_chain) - typedef boost::container::container_detail:: + typedef boost::container::dtl:: basic_multiallocation_chain<VoidPointer> base_t; public: diff --git a/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp b/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp index 5c7a420b4a..b8b7846c4a 100644 --- a/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp +++ b/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp @@ -72,11 +72,11 @@ class simple_seq_fit_impl typedef MutexFamily mutex_family; //!Pointer type to be used with the rest of the Interprocess framework typedef VoidPointer void_pointer; - typedef boost::container::container_detail:: + typedef boost::container::dtl:: basic_multiallocation_chain<VoidPointer> multiallocation_chain; typedef typename boost::intrusive::pointer_traits<char_ptr>::difference_type difference_type; - typedef typename boost::container::container_detail::make_unsigned<difference_type>::type size_type; + typedef typename boost::container::dtl::make_unsigned<difference_type>::type size_type; private: @@ -270,8 +270,8 @@ class simple_seq_fit_impl void priv_mark_new_allocated_block(block_ctrl *block); public: - static const size_type Alignment = ::boost::container::container_detail::alignment_of - < ::boost::container::container_detail::max_align_t>::value; + static const size_type Alignment = ::boost::container::dtl::alignment_of + < ::boost::container::dtl::max_align_t>::value; private: static const size_type BlockCtrlBytes = ipcdetail::ct_rounded_size<sizeof(block_ctrl), Alignment>::value; static const size_type BlockCtrlUnits = BlockCtrlBytes/Alignment; @@ -590,7 +590,7 @@ inline T* simple_seq_fit_impl<MutexFamily, VoidPointer>:: void *raw_reuse = reuse_ptr; void * const ret = priv_allocation_command (command, limit_size, prefer_in_recvd_out_size, raw_reuse, sizeof(T)); - BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::container_detail::alignment_of<T>::value)); + BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::dtl::alignment_of<T>::value)); reuse_ptr = static_cast<T*>(raw_reuse); return static_cast<T*>(ret); } diff --git a/boost/interprocess/mem_algo/rbtree_best_fit.hpp b/boost/interprocess/mem_algo/rbtree_best_fit.hpp index 7ad9d74cbb..7da31f73bf 100644 --- a/boost/interprocess/mem_algo/rbtree_best_fit.hpp +++ b/boost/interprocess/mem_algo/rbtree_best_fit.hpp @@ -94,7 +94,7 @@ class rbtree_best_fit typedef ipcdetail::basic_multiallocation_chain<VoidPointer> multiallocation_chain; typedef typename boost::intrusive::pointer_traits<char_ptr>::difference_type difference_type; - typedef typename boost::container::container_detail::make_unsigned<difference_type>::type size_type; + typedef typename boost::container::dtl::make_unsigned<difference_type>::type size_type; #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) @@ -331,8 +331,8 @@ class rbtree_best_fit public: static const size_type Alignment = !MemAlignment - ? size_type(::boost::container::container_detail::alignment_of - < ::boost::container::container_detail::max_align_t>::value) + ? size_type(::boost::container::dtl::alignment_of + < ::boost::container::dtl::max_align_t>::value) : size_type(MemAlignment) ; @@ -340,7 +340,7 @@ class rbtree_best_fit //Due to embedded bits in size, Alignment must be at least 4 BOOST_STATIC_ASSERT((Alignment >= 4)); //Due to rbtree size optimizations, Alignment must have at least pointer alignment - BOOST_STATIC_ASSERT((Alignment >= ::boost::container::container_detail::alignment_of<void_pointer>::value)); + BOOST_STATIC_ASSERT((Alignment >= ::boost::container::dtl::alignment_of<void_pointer>::value)); static const size_type AlignmentMask = (Alignment - 1); static const size_type BlockCtrlBytes = ipcdetail::ct_rounded_size<sizeof(block_ctrl), Alignment>::value; static const size_type BlockCtrlUnits = BlockCtrlBytes/Alignment; @@ -692,7 +692,7 @@ inline T* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>:: void* raw_reuse = reuse; void* const ret = priv_allocation_command(command, limit_size, prefer_in_recvd_out_size, raw_reuse, sizeof(T)); reuse = static_cast<T*>(raw_reuse); - BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::container_detail::alignment_of<T>::value)); + BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::dtl::alignment_of<T>::value)); return static_cast<T*>(ret); } diff --git a/boost/interprocess/offset_ptr.hpp b/boost/interprocess/offset_ptr.hpp index 24b044adf4..66d38cc965 100644 --- a/boost/interprocess/offset_ptr.hpp +++ b/boost/interprocess/offset_ptr.hpp @@ -66,7 +66,7 @@ namespace ipcdetail { OffsetType m_offset; //Distance between this object and pointee address - typename ::boost::container::container_detail::aligned_storage + typename ::boost::container::dtl::aligned_storage < sizeof(OffsetType)//for offset_type_alignment m_offset will be enough , (OffsetAlignment == offset_type_alignment) ? 1u : OffsetAlignment >::type alignment_helper; diff --git a/boost/interprocess/segment_manager.hpp b/boost/interprocess/segment_manager.hpp index d00f17716b..8e2221e4df 100644 --- a/boost/interprocess/segment_manager.hpp +++ b/boost/interprocess/segment_manager.hpp @@ -630,7 +630,7 @@ class segment_manager //!the named allocations performed in this segment manager const_named_iterator named_begin() const { - return make_transform_iterator + return (make_transform_iterator) (m_header.m_named_index.begin(), named_transform()); } @@ -638,7 +638,7 @@ class segment_manager //!the named allocations performed in this segment manager const_named_iterator named_end() const { - return make_transform_iterator + return (make_transform_iterator) (m_header.m_named_index.end(), named_transform()); } @@ -646,7 +646,7 @@ class segment_manager //!the unique allocations performed in this segment manager const_unique_iterator unique_begin() const { - return make_transform_iterator + return (make_transform_iterator) (m_header.m_unique_index.begin(), unique_transform()); } @@ -654,7 +654,7 @@ class segment_manager //!the unique allocations performed in this segment manager const_unique_iterator unique_end() const { - return make_transform_iterator + return (make_transform_iterator) (m_header.m_unique_index.end(), unique_transform()); } diff --git a/boost/interprocess/smart_ptr/intrusive_ptr.hpp b/boost/interprocess/smart_ptr/intrusive_ptr.hpp index e2cf45fdbb..585b9952d5 100644..100755 --- a/boost/interprocess/smart_ptr/intrusive_ptr.hpp +++ b/boost/interprocess/smart_ptr/intrusive_ptr.hpp @@ -32,6 +32,7 @@ #include <boost/interprocess/detail/utilities.hpp> #include <boost/intrusive/pointer_traits.hpp> #include <boost/move/adl_move_swap.hpp> +#include <boost/move/core.hpp> #include <iosfwd> // for std::basic_ostream @@ -48,8 +49,8 @@ namespace interprocess { //!intrusive_ptr<T, offset_ptr<void> > defines a class with a offset_ptr<T> member. //!Relies on unqualified calls to: //! -//! void intrusive_ptr_add_ref(T * p); -//! void intrusive_ptr_release(T * p); +//! void intrusive_ptr_add_ref(T * p) BOOST_NOEXCEPT; +//! void intrusive_ptr_release(T * p) BOOST_NOEXCEPT; //! //! with (p != 0) //! @@ -72,56 +73,73 @@ class intrusive_ptr typedef pointer this_type::*unspecified_bool_type; #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED + BOOST_COPYABLE_AND_MOVABLE(intrusive_ptr) + public: //!Constructor. Initializes internal pointer to 0. //!Does not throw - intrusive_ptr(): m_ptr(0) + intrusive_ptr() BOOST_NOEXCEPT + : m_ptr(0) {} //!Constructor. Copies pointer and if "p" is not zero and //!"add_ref" is true calls intrusive_ptr_add_ref(to_raw_pointer(p)). //!Does not throw - intrusive_ptr(const pointer &p, bool add_ref = true): m_ptr(p) + intrusive_ptr(const pointer &p, bool add_ref = true) BOOST_NOEXCEPT + : m_ptr(p) { if(m_ptr != 0 && add_ref) intrusive_ptr_add_ref(ipcdetail::to_raw_pointer(m_ptr)); } //!Copy constructor. Copies the internal pointer and if "p" is not //!zero calls intrusive_ptr_add_ref(to_raw_pointer(p)). Does not throw - intrusive_ptr(intrusive_ptr const & rhs) + intrusive_ptr(intrusive_ptr const & rhs) BOOST_NOEXCEPT : m_ptr(rhs.m_ptr) { if(m_ptr != 0) intrusive_ptr_add_ref(ipcdetail::to_raw_pointer(m_ptr)); } + //!Move constructor. Moves the internal pointer. Does not throw + intrusive_ptr(BOOST_RV_REF(intrusive_ptr) rhs) BOOST_NOEXCEPT + : m_ptr(rhs.m_ptr) + { + rhs.m_ptr = 0; + } + //!Constructor from related. Copies the internal pointer and if "p" is not //!zero calls intrusive_ptr_add_ref(to_raw_pointer(p)). Does not throw - template<class U> intrusive_ptr - (intrusive_ptr<U, VP> const & rhs) + template<class U> intrusive_ptr(intrusive_ptr<U, VP> const & rhs) BOOST_NOEXCEPT : m_ptr(rhs.get()) { if(m_ptr != 0) intrusive_ptr_add_ref(ipcdetail::to_raw_pointer(m_ptr)); } - //!Destructor. If internal pointer is not 0, calls - //!intrusive_ptr_release(to_raw_pointer(m_ptr)). Does not throw + //!Destructor. Calls reset(). Does not throw ~intrusive_ptr() { - if(m_ptr != 0) intrusive_ptr_release(ipcdetail::to_raw_pointer(m_ptr)); + reset(); } //!Assignment operator. Equivalent to intrusive_ptr(r).swap(*this). //!Does not throw - intrusive_ptr & operator=(intrusive_ptr const & rhs) + intrusive_ptr & operator=(BOOST_COPY_ASSIGN_REF(intrusive_ptr) rhs) BOOST_NOEXCEPT { this_type(rhs).swap(*this); return *this; } + //!Move Assignment operator + //!Does not throw + intrusive_ptr & operator=(BOOST_RV_REF(intrusive_ptr) rhs) BOOST_NOEXCEPT + { + rhs.swap(*this); + rhs.reset(); + return *this; + } + //!Assignment from related. Equivalent to intrusive_ptr(r).swap(*this). //!Does not throw - template<class U> intrusive_ptr & operator= - (intrusive_ptr<U, VP> const & rhs) + template<class U> intrusive_ptr & operator=(intrusive_ptr<U, VP> const & rhs) BOOST_NOEXCEPT { this_type(rhs).swap(*this); return *this; @@ -129,50 +147,60 @@ class intrusive_ptr //!Assignment from pointer. Equivalent to intrusive_ptr(r).swap(*this). //!Does not throw - intrusive_ptr & operator=(pointer rhs) + intrusive_ptr & operator=(pointer rhs) BOOST_NOEXCEPT { this_type(rhs).swap(*this); return *this; } + //!Release internal pointer and set it to 0. If internal pointer is not 0, calls + //!intrusive_ptr_release(to_raw_pointer(m_ptr)). Does not throw + void reset() BOOST_NOEXCEPT { + if(m_ptr != 0) { + pointer ptr = m_ptr; + m_ptr = 0; + intrusive_ptr_release(ipcdetail::to_raw_pointer(ptr)); + } + } + //!Returns a reference to the internal pointer. //!Does not throw - pointer &get() + pointer &get() BOOST_NOEXCEPT { return m_ptr; } //!Returns a reference to the internal pointer. //!Does not throw - const pointer &get() const + const pointer &get() const BOOST_NOEXCEPT { return m_ptr; } //!Returns *get(). //!Does not throw - T & operator*() const + T & operator*() const BOOST_NOEXCEPT { return *m_ptr; } //!Returns *get(). //!Does not throw - const pointer &operator->() const + const pointer &operator->() const BOOST_NOEXCEPT { return m_ptr; } //!Returns get(). //!Does not throw - pointer &operator->() + pointer &operator->() BOOST_NOEXCEPT { return m_ptr; } //!Conversion to boolean. //!Does not throw - operator unspecified_bool_type () const + operator unspecified_bool_type () const BOOST_NOEXCEPT { return m_ptr == 0? 0: &this_type::m_ptr; } //!Not operator. //!Does not throw - bool operator! () const + bool operator! () const BOOST_NOEXCEPT { return m_ptr == 0; } //!Exchanges the contents of the two smart pointers. //!Does not throw - void swap(intrusive_ptr & rhs) + void swap(intrusive_ptr & rhs) BOOST_NOEXCEPT { ::boost::adl_move_swap(m_ptr, rhs.m_ptr); } #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) @@ -185,49 +213,49 @@ class intrusive_ptr //!Does not throw template<class T, class U, class VP> inline bool operator==(intrusive_ptr<T, VP> const & a, - intrusive_ptr<U, VP> const & b) + intrusive_ptr<U, VP> const & b) BOOST_NOEXCEPT { return a.get() == b.get(); } //!Returns a.get() != b.get(). //!Does not throw template<class T, class U, class VP> inline bool operator!=(intrusive_ptr<T, VP> const & a, - intrusive_ptr<U, VP> const & b) + intrusive_ptr<U, VP> const & b) BOOST_NOEXCEPT { return a.get() != b.get(); } //!Returns a.get() == b. //!Does not throw template<class T, class VP> inline bool operator==(intrusive_ptr<T, VP> const & a, - const typename intrusive_ptr<T, VP>::pointer &b) + const typename intrusive_ptr<T, VP>::pointer &b) BOOST_NOEXCEPT { return a.get() == b; } //!Returns a.get() != b. //!Does not throw template<class T, class VP> inline bool operator!=(intrusive_ptr<T, VP> const & a, - const typename intrusive_ptr<T, VP>::pointer &b) + const typename intrusive_ptr<T, VP>::pointer &b) BOOST_NOEXCEPT { return a.get() != b; } //!Returns a == b.get(). //!Does not throw template<class T, class VP> inline bool operator==(const typename intrusive_ptr<T, VP>::pointer &a, - intrusive_ptr<T, VP> const & b) + intrusive_ptr<T, VP> const & b) BOOST_NOEXCEPT { return a == b.get(); } //!Returns a != b.get(). //!Does not throw template<class T, class VP> inline bool operator!=(const typename intrusive_ptr<T, VP>::pointer &a, - intrusive_ptr<T, VP> const & b) + intrusive_ptr<T, VP> const & b) BOOST_NOEXCEPT { return a != b.get(); } //!Returns a.get() < b.get(). //!Does not throw template<class T, class VP> inline bool operator<(intrusive_ptr<T, VP> const & a, - intrusive_ptr<T, VP> const & b) + intrusive_ptr<T, VP> const & b) BOOST_NOEXCEPT { return std::less<typename intrusive_ptr<T, VP>::pointer>() (a.get(), b.get()); @@ -237,34 +265,34 @@ bool operator<(intrusive_ptr<T, VP> const & a, //!Does not throw template<class T, class VP> inline void swap(intrusive_ptr<T, VP> & lhs, - intrusive_ptr<T, VP> & rhs) + intrusive_ptr<T, VP> & rhs) BOOST_NOEXCEPT { lhs.swap(rhs); } // operator<< template<class E, class T, class Y, class VP> inline std::basic_ostream<E, T> & operator<< - (std::basic_ostream<E, T> & os, intrusive_ptr<Y, VP> const & p) + (std::basic_ostream<E, T> & os, intrusive_ptr<Y, VP> const & p) BOOST_NOEXCEPT { os << p.get(); return os; } //!Returns p.get(). //!Does not throw template<class T, class VP> inline typename boost::interprocess::intrusive_ptr<T, VP>::pointer - to_raw_pointer(intrusive_ptr<T, VP> p) + to_raw_pointer(intrusive_ptr<T, VP> p) BOOST_NOEXCEPT { return p.get(); } /*Emulates static cast operator. Does not throw*/ /* template<class T, class U, class VP> inline boost::interprocess::intrusive_ptr<T, VP> static_pointer_cast - (boost::interprocess::intrusive_ptr<U, VP> const & p) + (boost::interprocess::intrusive_ptr<U, VP> const & p) BOOST_NOEXCEPT { return do_static_cast<U>(p.get()); } */ /*Emulates const cast operator. Does not throw*/ /* template<class T, class U, class VP> inline boost::interprocess::intrusive_ptr<T, VP> const_pointer_cast - (boost::interprocess::intrusive_ptr<U, VP> const & p) + (boost::interprocess::intrusive_ptr<U, VP> const & p) BOOST_NOEXCEPT { return do_const_cast<U>(p.get()); } */ @@ -272,7 +300,7 @@ inline boost::interprocess::intrusive_ptr<T, VP> const_pointer_cast /* template<class T, class U, class VP> inline boost::interprocess::intrusive_ptr<T, VP> dynamic_pointer_cast - (boost::interprocess::intrusive_ptr<U, VP> const & p) + (boost::interprocess::intrusive_ptr<U, VP> const & p) BOOST_NOEXCEPT { return do_dynamic_cast<U>(p.get()); } */ @@ -280,7 +308,7 @@ inline boost::interprocess::intrusive_ptr<T, VP> dynamic_pointer_cast /* template<class T, class U, class VP> inline boost::interprocess::intrusive_ptr<T, VP>reinterpret_pointer_cast - (boost::interprocess::intrusive_ptr<U, VP> const & p) + (boost::interprocess::intrusive_ptr<U, VP> const & p) BOOST_NOEXCEPT { return do_reinterpret_cast<U>(p.get()); } */ @@ -292,7 +320,7 @@ inline boost::interprocess::intrusive_ptr<T, VP>reinterpret_pointer_cast //!Returns p.get(). //!Does not throw template<class T, class VP> -inline T *to_raw_pointer(boost::interprocess::intrusive_ptr<T, VP> p) +inline T *to_raw_pointer(boost::interprocess::intrusive_ptr<T, VP> p) BOOST_NOEXCEPT { return p.get(); } #endif diff --git a/boost/interprocess/sync/detail/common_algorithms.hpp b/boost/interprocess/sync/detail/common_algorithms.hpp index 1a72d686b4..87739b8121 100644 --- a/boost/interprocess/sync/detail/common_algorithms.hpp +++ b/boost/interprocess/sync/detail/common_algorithms.hpp @@ -72,6 +72,49 @@ void try_based_lock(MutexType &m) } } +template<class MutexType> +void timed_based_lock(MutexType &m, unsigned const uCheckPeriodSec) +{ + const boost::posix_time::time_duration dur(0, 0, uCheckPeriodSec); + boost::posix_time::ptime deadline(microsec_clock::universal_time()+dur); + if(!m.timed_lock(deadline)){ + spin_wait swait; + do{ + deadline = microsec_clock::universal_time()+dur; + if(m.timed_lock(deadline)){ + break; + } + else{ + swait.yield(); + } + } + while(1); + } +} + +template<class MutexType> +void timed_based_timed_lock(MutexType &m, const boost::posix_time::ptime &abs_time, unsigned const uCheckPeriodSec) +{ + const boost::posix_time::time_duration dur(0, 0, uCheckPeriodSec); + boost::posix_time::ptime deadline(microsec_clock::universal_time()+dur); + if(abs_time <= deadline){ + m.timed_lock(abs_time); + } + else if(!m.timed_lock(deadline)){ + spin_wait swait; + do{ + deadline = microsec_clock::universal_time()+dur; + if(m.timed_lock(deadline)){ + break; + } + else{ + swait.yield(); + } + } + while(1); + } +} + } //namespace ipcdetail } //namespace interprocess } //namespace boost |