File indexing completed on 2025-12-15 10:09:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_THREAD_NULL_MUTEX_HPP
0012 #define BOOST_THREAD_NULL_MUTEX_HPP
0013
0014 #include <boost/thread/detail/config.hpp>
0015 #include <boost/thread/detail/delete.hpp>
0016 #include <boost/chrono/chrono.hpp>
0017
0018
0019
0020
0021 namespace boost
0022 {
0023
0024
0025
0026 class null_mutex
0027 {
0028 public:
0029
0030 BOOST_THREAD_NO_COPYABLE( null_mutex)
0031
0032 null_mutex() {}
0033
0034
0035 void lock()
0036 {
0037 }
0038
0039
0040
0041 bool try_lock()
0042 {
0043 return true;
0044 }
0045
0046
0047
0048 void unlock()
0049 {
0050 }
0051
0052 #ifdef BOOST_THREAD_USES_CHRONO
0053
0054
0055 template <typename Clock, typename Duration>
0056 bool try_lock_until(chrono::time_point<Clock, Duration> const &)
0057 {
0058 return true;
0059 }
0060
0061
0062
0063 template <typename Rep, typename Period>
0064 bool try_lock_for(chrono::duration<Rep, Period> const &)
0065 {
0066 return true;
0067 }
0068 #endif
0069
0070
0071
0072 void lock_shared()
0073 {
0074 }
0075
0076
0077
0078 bool try_lock_shared()
0079 {
0080 return true;
0081 }
0082
0083
0084
0085 void unlock_shared()
0086 {
0087 }
0088
0089
0090
0091 template <typename Clock, typename Duration>
0092 bool try_lock_shared_until(chrono::time_point<Clock, Duration> const &)
0093 {
0094 return true;
0095 }
0096
0097
0098 template <typename Rep, typename Period>
0099 bool try_lock_shared_for(chrono::duration<Rep, Period> const &)
0100 {
0101 return true;
0102 }
0103
0104
0105
0106 void lock_upgrade()
0107 {
0108 }
0109
0110
0111
0112 bool try_lock_upgrade()
0113 {
0114 return true;
0115 }
0116
0117
0118
0119 void unlock_upgrade()
0120 {
0121 }
0122
0123
0124
0125 template <typename Clock, typename Duration>
0126 bool try_lock_upgrade_until(chrono::time_point<Clock, Duration> const &)
0127 {
0128 return true;
0129 }
0130
0131
0132
0133 template <typename Rep, typename Period>
0134 bool try_lock_upgrade_for(chrono::duration<Rep, Period> const &)
0135 {
0136 return true;
0137 }
0138
0139
0140
0141 bool try_unlock_shared_and_lock()
0142 {
0143 return true;
0144 }
0145
0146 #ifdef BOOST_THREAD_USES_CHRONO
0147
0148
0149 template <typename Clock, typename Duration>
0150 bool try_unlock_shared_and_lock_until(chrono::time_point<Clock, Duration> const &)
0151 {
0152 return true;
0153 }
0154
0155
0156
0157 template <typename Rep, typename Period>
0158 bool try_unlock_shared_and_lock_for(chrono::duration<Rep, Period> const &)
0159 {
0160 return true;
0161 }
0162 #endif
0163
0164
0165
0166 void unlock_and_lock_shared()
0167 {
0168 }
0169
0170
0171
0172 bool try_unlock_shared_and_lock_upgrade()
0173 {
0174 return true;
0175 }
0176
0177 #ifdef BOOST_THREAD_USES_CHRONO
0178
0179
0180 template <typename Clock, typename Duration>
0181 bool try_unlock_shared_and_lock_upgrade_until(chrono::time_point<Clock, Duration> const &)
0182 {
0183 return true;
0184 }
0185
0186
0187
0188 template <typename Rep, typename Period>
0189 bool try_unlock_shared_and_lock_upgrade_for(chrono::duration<Rep, Period> const &)
0190 {
0191 return true;
0192 }
0193 #endif
0194
0195
0196
0197 void unlock_and_lock_upgrade()
0198 {
0199 }
0200
0201
0202
0203 void unlock_upgrade_and_lock()
0204 {
0205 }
0206
0207
0208
0209 bool try_unlock_upgrade_and_lock()
0210 {
0211 return true;
0212 }
0213
0214 #ifdef BOOST_THREAD_USES_CHRONO
0215
0216
0217 template <typename Clock, typename Duration>
0218 bool try_unlock_upgrade_and_lock_until(chrono::time_point<Clock, Duration> const &)
0219 {
0220 return true;
0221 }
0222
0223
0224
0225 template <typename Rep, typename Period>
0226 bool try_unlock_upgrade_and_lock_for(chrono::duration<Rep, Period> const &)
0227 {
0228 return true;
0229 }
0230 #endif
0231
0232
0233
0234 void unlock_upgrade_and_lock_shared()
0235 {
0236 }
0237
0238 };
0239
0240 }
0241
0242
0243 #endif