10#include <userver/engine/deadline.hpp>
11#include <userver/engine/impl/wait_list_fwd.hpp>
13USERVER_NAMESPACE_BEGIN
33 Mutex(
const Mutex&) =
delete;
34 Mutex(Mutex&&) =
delete;
35 Mutex& operator=(
const Mutex&) =
delete;
36 Mutex& operator=(Mutex&&) =
delete;
69 template <
typename Rep,
typename Period>
70 [[nodiscard]]
bool try_lock_for(
const std::chrono::duration<Rep, Period>&);
81 template <
typename Clock,
typename Duration>
83 const std::chrono::time_point<Clock, Duration>&);
91 utils::FastPimpl<Impl, 96,
alignof(
void*)> impl_;
94template <
typename Rep,
typename Period>
95bool Mutex::
try_lock_for(
const std::chrono::duration<Rep, Period>& duration) {
96 return try_lock_until(Deadline::FromDuration(duration));
99template <
typename Clock,
typename Duration>
101 const std::chrono::time_point<Clock, Duration>& until) {
102 return try_lock_until(Deadline::FromTimePoint(until));