5 #ifndef DOXYGEN_SKIP_PROPERTY
11 inline namespace mutex_v2
13 #endif //DOXYGEN_SKIP_PROPERTY
27 template<
class... _Mtxs>
36 bool is_locked()
const;
39 struct [[nodiscard]] awaiter;
40 struct [[nodiscard]] manual_awaiter;
46 awaiter lock()
const noexcept;
53 awaiter
operator co_await()
const noexcept;
64 struct [[nodiscard]] try_awaiter;
72 try_awaiter try_lock()
const noexcept;
74 struct [[nodiscard]] unlock_awaiter;
80 unlock_awaiter unlock()
const noexcept;
83 struct [[nodiscard]] timeout_awaiter;
90 template <
class _Rep,
class _Period>
91 timeout_awaiter try_lock_for(
const std::chrono::duration<_Rep, _Period>& dt)
const noexcept;
98 template <
class _Rep,
class _Period>
99 timeout_awaiter try_lock_until(
const std::chrono::time_point<_Rep, _Period>& tp)
const noexcept;
107 void lock(
void* unique_address)
const;
113 bool try_lock(
void* unique_address)
const;
120 template <
class _Rep,
class _Period>
121 bool try_lock_for(
const std::chrono::duration<_Rep, _Period>& dt,
void* unique_address);
128 template <
class _Rep,
class _Period>
129 bool try_lock_until(
const std::chrono::time_point<_Rep, _Period>& tp,
void* unique_address);
135 void unlock(
void* unique_address)
const;
143 template<
class... _Mtxs
144 #ifndef DOXYGEN_SKIP_PROPERTY
145 ,
typename = std::enable_if_t<std::conjunction_v<std::is_same<remove_cvref_t<_Mtxs>,
mutex_t>...>>
146 #endif //DOXYGEN_SKIP_PROPERTY
156 template<
class... _Mtxs
157 #ifndef DOXYGEN_SKIP_PROPERTY
158 ,
typename = std::enable_if_t<std::conjunction_v<std::is_same<remove_cvref_t<_Mtxs>,
mutex_t>...>>
159 #endif //DOXYGEN_SKIP_PROPERTY
168 template<
class... _Mtxs
169 #ifndef DOXYGEN_SKIP_PROPERTY
170 ,
typename = std::enable_if_t<std::conjunction_v<std::is_same<remove_cvref_t<_Mtxs>,
mutex_t>...>>
171 #endif //DOXYGEN_SKIP_PROPERTY
182 template<
class... _Mtxs
183 #ifndef DOXYGEN_SKIP_PROPERTY
184 ,
typename = std::enable_if_t<std::conjunction_v<std::is_same<remove_cvref_t<_Mtxs>,
mutex_t>...>>
185 #endif //DOXYGEN_SKIP_PROPERTY
187 static batch_unlock_t<_Mtxs...> lock(
void* unique_address, _Mtxs&... mtxs);
195 template<
class... _Mtxs
196 #ifndef DOXYGEN_SKIP_PROPERTY
197 ,
typename = std::enable_if_t<std::conjunction_v<std::is_same<remove_cvref_t<_Mtxs>,
mutex_t>...>>
198 #endif //DOXYGEN_SKIP_PROPERTY
207 template<
class... _Mtxs
208 #ifndef DOXYGEN_SKIP_PROPERTY
209 ,
typename = std::enable_if_t<std::conjunction_v<std::is_same<remove_cvref_t<_Mtxs>,
mutex_t>...>>
210 #endif //DOXYGEN_SKIP_PROPERTY
212 static void unlock(
void* unique_address, _Mtxs&... mtxs);
219 mutex_t(std::adopt_lock_t) noexcept;
227 #ifndef DOXYGEN_SKIP_PROPERTY
228 typedef std::shared_ptr<detail::mutex_v2_impl> mutex_impl_ptr;
229 typedef std::chrono::system_clock clock_type;
231 struct _MutexAwaitAssembleT;
235 mutex_impl_ptr _mutex;
236 #endif //DOXYGEN_SKIP_PROPERTY