17#ifndef CMSIS_PLUS_ESTD_MUTEX_
18#define CMSIS_PLUS_ESTD_MUTEX_
23#pragma GCC diagnostic push
25#pragma clang diagnostic ignored "-Wgnu-include-next"
28#pragma GCC diagnostic pop
40#pragma GCC diagnostic push
42#pragma clang diagnostic ignored "-Wc++98-compat"
76 operator= (const
mutex&) = delete;
146 template<
typename Rep_T,
typename Period_T>
148 try_lock_for (
const std::chrono::duration<Rep_T, Period_T>& rel_time);
150 template<
typename Clock_T,
typename Duration_T>
153 const std::chrono::time_point<Clock_T, Duration_T>& abs_time);
170 template<
typename Rep_T,
typename Period_T>
172 try_lock_for (
const std::chrono::duration<Rep_T, Period_T>& rel_time);
174 template<
typename Clock_T,
typename Duration_T>
177 const std::chrono::time_point<Clock_T, Duration_T>& abs_time);
215#pragma GCC diagnostic push
216#if defined(__clang__)
217#elif defined(__GNUC__)
218#pragma GCC diagnostic ignored "-Waggregate-return"
221 template<
typename Rep_T,
typename Period_T>
224 const std::chrono::duration<Rep_T, Period_T>& rel_time)
226 using namespace std::chrono;
228 if (rel_time > duration<Rep_T, Period_T>::zero ())
241 else if (res == ETIMEDOUT)
247 "timed_mutex try_lock failed");
251 template<
typename Clock_T,
typename Duration_T>
254 const std::chrono::time_point<Clock_T, Duration_T>& abs_time)
256 using clock = Clock_T;
258 auto now = clock::now ();
259 while (now < abs_time)
271#pragma GCC diagnostic pop
275 template<
typename Rep_T,
typename Period_T>
278 const std::chrono::duration<Rep_T, Period_T>& rel_time)
280 using namespace std::chrono;
282 if (rel_time > duration<Rep_T, Period_T>::zero ())
295 else if (res == ETIMEDOUT)
301 "timed_mutex try_lock failed");
305 template<
typename Clock_T,
typename Duration_T>
308 const std::chrono::time_point<Clock_T, Duration_T>& abs_time)
310 using clock = Clock_T;
312 auto now = clock::now ();
313 while (now < abs_time)
329#pragma GCC diagnostic pop
331#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.