1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_INTERPROCESS_NULL_MUTEX_HPP
12 #define BOOST_INTERPROCESS_NULL_MUTEX_HPP
14 #ifndef BOOST_CONFIG_HPP
15 # include <boost/config.hpp>
18 #if defined(BOOST_HAS_PRAGMA_ONCE)
22 #include <boost/interprocess/detail/config_begin.hpp>
23 #include <boost/interprocess/detail/workaround.hpp>
27 //!Describes null_mutex classes
31 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
36 #endif //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
38 namespace interprocess {
40 //!Implements a mutex that simulates a mutex without doing any operation and
41 //!simulates a successful operation.
44 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
45 null_mutex(const null_mutex&);
46 null_mutex &operator= (const null_mutex&);
47 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
58 //!Simulates a mutex lock() operation. Empty function.
61 //!Simulates a mutex try_lock() operation.
62 //!Equivalent to "return true;"
66 //!Simulates a mutex timed_lock() operation.
67 //!Equivalent to "return true;"
68 bool timed_lock(const boost::posix_time::ptime &)
71 //!Simulates a mutex unlock() operation.
75 //!Simulates a mutex lock_sharable() operation.
77 void lock_sharable(){}
79 //!Simulates a mutex try_lock_sharable() operation.
80 //!Equivalent to "return true;"
81 bool try_lock_sharable()
84 //!Simulates a mutex timed_lock_sharable() operation.
85 //!Equivalent to "return true;"
86 bool timed_lock_sharable(const boost::posix_time::ptime &)
89 //!Simulates a mutex unlock_sharable() operation.
91 void unlock_sharable(){}
93 //!Simulates a mutex lock_upgradable() operation.
95 void lock_upgradable(){}
97 //!Simulates a mutex try_lock_upgradable() operation.
98 //!Equivalent to "return true;"
99 bool try_lock_upgradable()
102 //!Simulates a mutex timed_lock_upgradable() operation.
103 //!Equivalent to "return true;"
104 bool timed_lock_upgradable(const boost::posix_time::ptime &)
107 //!Simulates a mutex unlock_upgradable() operation.
109 void unlock_upgradable(){}
111 //!Simulates unlock_and_lock_upgradable().
113 void unlock_and_lock_upgradable(){}
115 //!Simulates unlock_and_lock_sharable().
117 void unlock_and_lock_sharable(){}
119 //!Simulates unlock_upgradable_and_lock_sharable().
121 void unlock_upgradable_and_lock_sharable(){}
125 //!Simulates unlock_upgradable_and_lock().
127 void unlock_upgradable_and_lock(){}
129 //!Simulates try_unlock_upgradable_and_lock().
130 //!Equivalent to "return true;"
131 bool try_unlock_upgradable_and_lock()
134 //!Simulates timed_unlock_upgradable_and_lock().
135 //!Equivalent to "return true;"
136 bool timed_unlock_upgradable_and_lock(const boost::posix_time::ptime &)
139 //!Simulates try_unlock_sharable_and_lock().
140 //!Equivalent to "return true;"
141 bool try_unlock_sharable_and_lock()
144 //!Simulates try_unlock_sharable_and_lock_upgradable().
145 //!Equivalent to "return true;"
146 bool try_unlock_sharable_and_lock_upgradable()
150 } //namespace interprocess {
151 } //namespace boost {
153 #include <boost/interprocess/detail/config_end.hpp>
155 #endif //BOOST_INTERPROCESS_NULL_MUTEX_HPP