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