Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/interprocess/sync/sharable_lock.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
14 ////////////////////////////////////////////////////////////////////////////// | 14 ////////////////////////////////////////////////////////////////////////////// |
15 | 15 |
16 #ifndef BOOST_INTERPROCESS_SHARABLE_LOCK_HPP | 16 #ifndef BOOST_INTERPROCESS_SHARABLE_LOCK_HPP |
17 #define BOOST_INTERPROCESS_SHARABLE_LOCK_HPP | 17 #define BOOST_INTERPROCESS_SHARABLE_LOCK_HPP |
18 | 18 |
19 #if (defined _MSC_VER) && (_MSC_VER >= 1200) | 19 #ifndef BOOST_CONFIG_HPP |
20 # include <boost/config.hpp> | |
21 #endif | |
22 # | |
23 #if defined(BOOST_HAS_PRAGMA_ONCE) | |
20 # pragma once | 24 # pragma once |
21 #endif | 25 #endif |
22 | 26 |
23 #include <boost/interprocess/detail/config_begin.hpp> | 27 #include <boost/interprocess/detail/config_begin.hpp> |
24 #include <boost/interprocess/detail/workaround.hpp> | 28 #include <boost/interprocess/detail/workaround.hpp> |
25 #include <boost/interprocess/interprocess_fwd.hpp> | 29 #include <boost/interprocess/interprocess_fwd.hpp> |
26 #include <boost/interprocess/sync/lock_options.hpp> | 30 #include <boost/interprocess/sync/lock_options.hpp> |
27 #include <boost/interprocess/exceptions.hpp> | 31 #include <boost/interprocess/exceptions.hpp> |
28 #include <boost/interprocess/detail/mpl.hpp> | 32 #include <boost/interprocess/detail/mpl.hpp> |
29 #include <boost/interprocess/detail/type_traits.hpp> | 33 #include <boost/interprocess/detail/type_traits.hpp> |
30 #include <boost/move/move.hpp> | 34 #include <boost/interprocess/detail/simple_swap.hpp> |
35 #include <boost/move/utility_core.hpp> | |
31 #include <boost/interprocess/detail/posix_time_types_wrk.hpp> | 36 #include <boost/interprocess/detail/posix_time_types_wrk.hpp> |
32 | 37 |
33 //!\file | 38 //!\file |
34 //!Describes the upgradable_lock class that serves to acquire the upgradable | 39 //!Describes the upgradable_lock class that serves to acquire the upgradable |
35 //!lock of a mutex. | 40 //!lock of a mutex. |
49 template <class SharableMutex> | 54 template <class SharableMutex> |
50 class sharable_lock | 55 class sharable_lock |
51 { | 56 { |
52 public: | 57 public: |
53 typedef SharableMutex mutex_type; | 58 typedef SharableMutex mutex_type; |
54 /// @cond | 59 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) |
55 private: | 60 private: |
56 typedef sharable_lock<SharableMutex> this_type; | 61 typedef sharable_lock<SharableMutex> this_type; |
57 explicit sharable_lock(scoped_lock<mutex_type>&); | 62 explicit sharable_lock(scoped_lock<mutex_type>&); |
58 typedef bool this_type::*unspecified_bool_type; | 63 typedef bool this_type::*unspecified_bool_type; |
59 BOOST_MOVABLE_BUT_NOT_COPYABLE(sharable_lock) | 64 BOOST_MOVABLE_BUT_NOT_COPYABLE(sharable_lock) |
60 /// @endcond | 65 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED |
61 public: | 66 public: |
62 | 67 |
63 //!Effects: Default constructs a sharable_lock. | 68 //!Effects: Default constructs a sharable_lock. |
64 //!Postconditions: owns() == false and mutex() == 0. | 69 //!Postconditions: owns() == false and mutex() == 0. |
65 sharable_lock() | 70 sharable_lock() |
284 | 289 |
285 //!Effects: Swaps state with moved lock. | 290 //!Effects: Swaps state with moved lock. |
286 //!Throws: Nothing. | 291 //!Throws: Nothing. |
287 void swap(sharable_lock<mutex_type> &other) | 292 void swap(sharable_lock<mutex_type> &other) |
288 { | 293 { |
289 std::swap(mp_mutex, other.mp_mutex); | 294 (simple_swap)(mp_mutex, other.mp_mutex); |
290 std::swap(m_locked, other.m_locked); | 295 (simple_swap)(m_locked, other.m_locked); |
291 } | 296 } |
292 | 297 |
293 /// @cond | 298 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) |
294 private: | 299 private: |
295 mutex_type *mp_mutex; | 300 mutex_type *mp_mutex; |
296 bool m_locked; | 301 bool m_locked; |
297 /// @endcond | 302 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED |
298 }; | 303 }; |
299 | 304 |
300 } // namespace interprocess | 305 } // namespace interprocess |
301 } // namespace boost | 306 } // namespace boost |
302 | 307 |