µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::estd Namespace Reference

Embedded std namespace. More...

Namespaces

namespace  chrono
 
namespace  pmr
 

Classes

struct  __lock_external
 
class  condition_variable
 
class  condition_variable_any
 
class  lock_guard
 
class  mutex
 
class  recursive_mutex
 
class  recursive_timed_mutex
 
class  timed_mutex
 

Functions

void __throw_bad_alloc (void)
 
void __throw_cmsis_error (int ev, const char *what_arg)
 
void __throw_system_error (int ev, const char *what_arg)
 
enum class  cv_status {
  cv_status::no_timeout ,
  cv_status::timeout
}
 
void notify_all_at_thread_exit (condition_variable &cond, std::unique_lock< mutex > lk)
 

Detailed Description

Function Documentation

◆ __throw_bad_alloc()

void os::estd::__throw_bad_alloc ( void  )

Definition at line 42 of file memory-resource.cpp.

43 {
44#if defined(__EXCEPTIONS)
45 throw std::bad_alloc ();
46#else
47 trace::printf ("bad_alloc()\n");
48 std::abort ();
49#endif
50 }
int printf(const char *format,...)
Write a formatted string to the trace device.
Definition trace.cpp:59

References os::trace::printf().

Referenced by os::memory::block_pool_typed_allocated< T, A >::block_pool_typed_allocated(), os::memory::first_fit_top_allocated< A >::first_fit_top_allocated(), os::memory::lifo_allocated< A >::lifo_allocated(), os::memory::null_memory_resource::do_allocate(), operator new(), os_rtos_application_out_of_memory_hook(), and os_rtos_system_out_of_memory_hook().

◆ __throw_cmsis_error()

void os::estd::__throw_cmsis_error ( int  ev,
const char *  what_arg 
)

Definition at line 124 of file system-error.cpp.

125 {
126#if defined(__EXCEPTIONS)
127 // error: copying parameter of type 'os::estd::cmsis_error_category' when
128 // binding a reference to a temporary would invoke a deleted constructor
129 // in C++98 [-Werror,-Wc++98-compat-bind-to-temporary-copy]
130 throw std::system_error (std::error_code (ev, cmsis_error_category ()),
131 what_arg);
132#else
133 trace_printf ("system_error(%d, %s)\n", ev, what_arg);
134 std::abort ();
135#endif
136 }
int trace_printf(const char *format,...)

References __throw_cmsis_error(), and trace_printf().

Referenced by __throw_cmsis_error(), os::estd::mutex::lock(), os::estd::recursive_mutex::lock(), os::estd::condition_variable::notify_all(), os::estd::condition_variable::notify_one(), os::estd::mutex::try_lock(), os::estd::recursive_mutex::try_lock(), os::estd::mutex::unlock(), os::estd::recursive_mutex::unlock(), and os::estd::condition_variable::wait().

◆ __throw_system_error()

void os::estd::__throw_system_error ( int  ev,
const char *  what_arg 
)

Definition at line 109 of file system-error.cpp.

110 {
111#if defined(__EXCEPTIONS)
112 // error: copying parameter of type 'os::estd::system_error_category'
113 // when binding a reference to a temporary would invoke a deleted
114 // constructor in C++98 [-Werror,-Wc++98-compat-bind-to-temporary-copy]
115 throw std::system_error (std::error_code (ev, system_error_category ()),
116 what_arg);
117#else
118 trace_printf ("system_error(%d, %s)\n", ev, what_arg);
119 std::abort ();
120#endif
121 }

References __throw_system_error(), and trace_printf().

Referenced by __throw_system_error(), os::estd::timed_mutex::try_lock_for(), os::estd::recursive_timed_mutex::try_lock_for(), and os::estd::condition_variable::wait().