32#ifndef CMSIS_PLUS_ESTD_MUTEX_
33#define CMSIS_PLUS_ESTD_MUTEX_
38#pragma GCC diagnostic push
40#pragma clang diagnostic ignored "-Wgnu-include-next"
43#pragma GCC diagnostic pop
55#pragma GCC diagnostic push
58#pragma clang diagnostic ignored "-Wc++98-compat"
92 operator= (const
mutex&) = delete;
162 template<
typename Rep_T,
typename Period_T>
164 try_lock_for (
const std::chrono::duration<Rep_T, Period_T>& rel_time);
166 template<
typename Clock_T,
typename Duration_T>
169 const std::chrono::time_point<Clock_T, Duration_T>& abs_time);
186 template<
typename Rep_T,
typename Period_T>
188 try_lock_for (
const std::chrono::duration<Rep_T, Period_T>& rel_time);
190 template<
typename Clock_T,
typename Duration_T>
193 const std::chrono::time_point<Clock_T, Duration_T>& abs_time);
233#pragma GCC diagnostic push
234#pragma GCC diagnostic ignored "-Waggregate-return"
236 template<
typename Rep_T,
typename Period_T>
239 const std::chrono::duration<Rep_T, Period_T>& rel_time)
241 using namespace std::chrono;
243 if (rel_time > duration<Rep_T, Period_T>::zero ())
256 else if (res == ETIMEDOUT)
262 "timed_mutex try_lock failed");
266 template<
typename Clock_T,
typename Duration_T>
269 const std::chrono::time_point<Clock_T, Duration_T>& abs_time)
271 using clock = Clock_T;
273 auto now = clock::now ();
274 while (now < abs_time)
286#pragma GCC diagnostic pop
290 template<
typename Rep_T,
typename Period_T>
293 const std::chrono::duration<Rep_T, Period_T>& rel_time)
295 using namespace std::chrono;
297 if (rel_time > duration<Rep_T, Period_T>::zero ())
310 else if (res == ETIMEDOUT)
316 "timed_mutex try_lock failed");
320 template<
typename Clock_T,
typename Duration_T>
323 const std::chrono::time_point<Clock_T, Duration_T>& abs_time)
325 using clock = Clock_T;
327 auto now = clock::now ();
328 while (now < abs_time)
344#pragma GCC diagnostic pop
346#if defined(OS_HAS_STD_THREADS)
mutex & operator=(const mutex &)=delete
native_handle_type native_handle()
recursive_mutex(const recursive_mutex &)=delete
~recursive_mutex()=default
native_type * native_handle_type
native_handle_type native_handle()
recursive_timed_mutex(const recursive_timed_mutex &)=delete
bool try_lock_for(const std::chrono::duration< Rep_T, Period_T > &rel_time)
bool try_lock_until(const std::chrono::time_point< Clock_T, Duration_T > &abs_time)
~recursive_timed_mutex()=default
recursive_timed_mutex()=default
bool try_lock_for(const std::chrono::duration< Rep_T, Period_T > &rel_time)
bool try_lock_until(const std::chrono::time_point< Clock_T, Duration_T > &abs_time)
timed_mutex(const timed_mutex &)=delete
result_t timed_lock(clock::duration_t timeout)
Timed attempt to lock/acquire the mutex.
port::clock::duration_t duration_t
Type of variables holding clock durations.
static const attributes_recursive initializer_recursive
Default recursive mutex initialiser.
systick_clock::duration systicks
constexpr std::enable_if< std::chrono::__is_duration< _To >::value, _To >::type ceil(std::chrono::duration< Rep_T, Period_T > d)
void __throw_system_error(int ev, const char *what_arg)
@ ok
Function completed; no errors or events occurred.
uint32_t result_t
Type of values returned by RTOS functions.
Single file µOS++ RTOS definitions.