27 #include "rtos/mbed_rtos_types.h" 28 #include "rtos/internal/mbed_rtos1_types.h" 29 #include "rtos/internal/mbed_rtos_storage.h" 30 #include "platform/Callback.h" 31 #include "platform/mbed_toolchain.h" 32 #include "platform/NonCopyable.h" 33 #include "rtos/Semaphore.h" 34 #include "rtos/Mutex.h" 36 #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) 104 Thread(osPriority priority = osPriorityNormal,
106 unsigned char *stack_mem =
nullptr,
const char *name =
nullptr)
108 constructor(priority,
stack_size, stack_mem, name);
124 Thread(uint32_t tz_module, osPriority priority = osPriorityNormal,
126 unsigned char *stack_mem =
nullptr,
const char *name =
nullptr)
128 constructor(tz_module, priority,
stack_size, stack_mem, name);
248 osThreadId_t
get_id()
const;
259 void constructor(osPriority priority = osPriorityNormal,
261 unsigned char *stack_mem =
nullptr,
262 const char *name =
nullptr);
263 void constructor(uint32_t tz_module,
264 osPriority priority = osPriorityNormal,
266 unsigned char *stack_mem =
nullptr,
267 const char *name =
nullptr);
268 static void _thunk(
void *thread_ptr);
272 osThreadAttr_t _attr;
276 mutable Mutex _mutex;
277 mbed_rtos_storage_thread_t _obj_mem;
The Thread class allow defining, creating, and controlling thread functions in the system...
uint32_t flags_set(uint32_t flags)
Set the specified Thread Flags for the thread.
Waiting for a memory pool.
The Semaphore class is used to manage and protect access to a set of shared resources.
osStatus terminate()
Terminate execution of a thread and remove it from Active Threads.
osStatus set_priority(osPriority priority)
Set priority of an active thread.
Thread(uint32_t tz_module, osPriority priority=osPriorityNormal, uint32_t stack_size=OS_STACK_SIZE, unsigned char *stack_mem=nullptr, const char *name=nullptr)
Allocate a new thread without starting execution.
NOT USED (Mail is implemented as MemoryPool and Queue)
uint32_t free_stack() const
Get the currently unused stack memory for this Thread.
Waiting for a mutex event to occur.
Prevents generation of copy constructor and copy assignment operator in derived classes.
Waiting for message to be send.
Thread(osPriority priority=osPriorityNormal, uint32_t stack_size=OS_STACK_SIZE, unsigned char *stack_mem=nullptr, const char *name=nullptr)
Allocate a new thread without starting execution.
Waiting for message to arrive.
State
State of the Thread.
Waiting for a thread flag to be set.
osStatus join()
Wait for thread to terminate.
Waiting for a event flag to be set.
Waiting for thread to join.
osPriority get_priority() const
Get priority of an active thread.
The Mutex class is used to synchronize the execution of threads.
uint32_t used_stack() const
Get the currently used stack memory for this Thread.
State get_state() const
State of this Thread.
Waiting for a delay to occur.
const char * get_name() const
Get thread name.
Waiting for a semaphore event to occur.
virtual ~Thread()
Thread destructor.
osStatus start(mbed::Callback< void()> task)
Starts a thread executing the specified function.
osThreadId_t get_id() const
Get thread id.
Callback class based on template specialization.
The task has been deleted or not started.
uint32_t max_stack() const
Get the maximum stack memory usage to date for this Thread.
uint32_t stack_size() const
Get the total stack memory size for this Thread.