comparison DEPENDENCIES/generic/include/boost/interprocess/sync/upgradable_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_UPGRADABLE_LOCK_HPP 16 #ifndef BOOST_INTERPROCESS_UPGRADABLE_LOCK_HPP
17 #define BOOST_INTERPROCESS_UPGRADABLE_LOCK_HPP 17 #define BOOST_INTERPROCESS_UPGRADABLE_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>
26 #include <boost/interprocess/sync/lock_options.hpp> 30 #include <boost/interprocess/sync/lock_options.hpp>
27 #include <boost/interprocess/detail/mpl.hpp> 31 #include <boost/interprocess/detail/mpl.hpp>
28 #include <boost/interprocess/detail/type_traits.hpp> 32 #include <boost/interprocess/detail/type_traits.hpp>
29 33
30 #include <boost/interprocess/exceptions.hpp> 34 #include <boost/interprocess/exceptions.hpp>
31 #include <boost/move/move.hpp> 35 #include <boost/move/utility_core.hpp>
32 #include <boost/interprocess/detail/posix_time_types_wrk.hpp> 36 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
33 37
34 //!\file 38 //!\file
35 //!Describes the upgradable_lock class that serves to acquire the upgradable 39 //!Describes the upgradable_lock class that serves to acquire the upgradable
36 //!lock of a mutex. 40 //!lock of a mutex.
50 template <class UpgradableMutex> 54 template <class UpgradableMutex>
51 class upgradable_lock 55 class upgradable_lock
52 { 56 {
53 public: 57 public:
54 typedef UpgradableMutex mutex_type; 58 typedef UpgradableMutex mutex_type;
55 /// @cond 59 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
56 private: 60 private:
57 typedef upgradable_lock<UpgradableMutex> this_type; 61 typedef upgradable_lock<UpgradableMutex> this_type;
58 explicit upgradable_lock(scoped_lock<mutex_type>&); 62 explicit upgradable_lock(scoped_lock<mutex_type>&);
59 typedef bool this_type::*unspecified_bool_type; 63 typedef bool this_type::*unspecified_bool_type;
60 BOOST_MOVABLE_BUT_NOT_COPYABLE(upgradable_lock) 64 BOOST_MOVABLE_BUT_NOT_COPYABLE(upgradable_lock)
61 /// @endcond 65 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
62 public: 66 public:
63 67
64 //!Effects: Default constructs a upgradable_lock. 68 //!Effects: Default constructs a upgradable_lock.
65 //!Postconditions: owns() == false and mutex() == 0. 69 //!Postconditions: owns() == false and mutex() == 0.
66 upgradable_lock() 70 upgradable_lock()
288 292
289 //!Effects: Swaps state with moved lock. 293 //!Effects: Swaps state with moved lock.
290 //!Throws: Nothing. 294 //!Throws: Nothing.
291 void swap(upgradable_lock<mutex_type> &other) 295 void swap(upgradable_lock<mutex_type> &other)
292 { 296 {
293 std::swap(mp_mutex, other.mp_mutex); 297 (simple_swap)(mp_mutex, other.mp_mutex);
294 std::swap(m_locked, other.m_locked); 298 (simple_swap)(m_locked, other.m_locked);
295 } 299 }
296 300
297 /// @cond 301 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
298 private: 302 private:
299 mutex_type *mp_mutex; 303 mutex_type *mp_mutex;
300 bool m_locked; 304 bool m_locked;
301 /// @endcond 305 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
302 }; 306 };
303 307
304 } // namespace interprocess 308 } // namespace interprocess
305 } // namespace boost 309 } // namespace boost
306 310