File indexing completed on 2026-05-26 07:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_INTERPROCESS_NULL_MUTEX_HPP
0012 #define BOOST_INTERPROCESS_NULL_MUTEX_HPP
0013
0014 #ifndef BOOST_CONFIG_HPP
0015 # include <boost/config.hpp>
0016 #endif
0017 0018 ">#
0019 #if defined(BOOST_HAS_PRAGMA_ONCE)
0020 # pragma once
0021 #endif
0022
0023 #include <boost/interprocess/detail/config_begin.hpp>
0024 #include <boost/interprocess/detail/workaround.hpp>
0025
0026
0027
0028
0029
0030 namespace boost {
0031 namespace interprocess {
0032
0033
0034
0035 class null_mutex
0036 {
0037 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0038 null_mutex(const null_mutex&);
0039 null_mutex &operator= (const null_mutex&);
0040 #endif
0041 public:
0042
0043
0044
0045 null_mutex() BOOST_NOEXCEPT {}
0046
0047
0048
0049 ~null_mutex(){}
0050
0051
0052 void lock(){}
0053
0054
0055
0056 bool try_lock()
0057 { return true; }
0058
0059
0060
0061 template<class TimePoint>
0062 bool timed_lock(const TimePoint &)
0063 { return true; }
0064
0065
0066
0067 template<class TimePoint>
0068 bool try_lock_until(const TimePoint &)
0069 { return true; }
0070
0071
0072
0073 template<class Duration>
0074 bool try_lock_for(const Duration &)
0075 { return true; }
0076
0077
0078
0079 void unlock(){}
0080
0081
0082
0083 void lock_sharable(){}
0084
0085
0086
0087 void lock_shared()
0088 { this->lock_sharable(); }
0089
0090
0091
0092 bool try_lock_sharable()
0093 { return true; }
0094
0095
0096
0097 bool try_lock_shared()
0098 { return this->try_lock_sharable(); }
0099
0100
0101
0102 template<class TimePoint>
0103 bool timed_lock_sharable(const TimePoint &)
0104 { return true; }
0105
0106
0107
0108 void unlock_sharable(){}
0109
0110
0111
0112 void unlock_shared()
0113 { this->unlock_sharable(); }
0114
0115
0116
0117 void lock_upgradable(){}
0118
0119
0120
0121 bool try_lock_upgradable()
0122 { return true; }
0123
0124
0125
0126 template<class TimePoint>
0127 bool timed_lock_upgradable(const TimePoint &)
0128 { return true; }
0129
0130
0131
0132 void unlock_upgradable(){}
0133
0134
0135
0136 void unlock_and_lock_upgradable(){}
0137
0138
0139
0140 void unlock_and_lock_sharable(){}
0141
0142
0143
0144 void unlock_upgradable_and_lock_sharable(){}
0145
0146
0147
0148
0149
0150 void unlock_upgradable_and_lock(){}
0151
0152
0153
0154 bool try_unlock_upgradable_and_lock()
0155 { return true; }
0156
0157
0158
0159 template<class TimePoint>
0160 bool timed_unlock_upgradable_and_lock(const TimePoint &)
0161 { return true; }
0162
0163
0164
0165 bool try_unlock_sharable_and_lock()
0166 { return true; }
0167
0168
0169
0170 bool try_unlock_sharable_and_lock_upgradable()
0171 { return true; }
0172 };
0173
0174 }
0175 }
0176
0177 #include <boost/interprocess/detail/config_end.hpp>
0178
0179 #endif