Skip to content
Snippets Groups Projects
Commit 7835db5e authored by Martine Lenders's avatar Martine Lenders Committed by Martine Lenders
Browse files

core: provide function to check msg queue initialization

This makes it easier to refactor that part of the `thread_t` structure
later on.
parent a98edd33
No related branches found
No related tags found
No related merge requests found
...@@ -527,6 +527,26 @@ void thread_stack_print(void); ...@@ -527,6 +527,26 @@ void thread_stack_print(void);
*/ */
void thread_print_stack(void); void thread_print_stack(void);
/**
* @brief Checks if a thread has an initialized message queue
*
* @see @ref msg_init_queue()
*
* @param[in] thread The thread to check for
*
* @return `== 0`, if @p thread has no initialized message queue
* @return `!= 0`, if @p thread has its message queue initialized
*/
static inline int thread_has_msg_queue(const volatile struct _thread *thread)
{
#if defined(MODULE_CORE_MSG) || defined(DOXYGEN)
return (thread->msg_array != NULL);
#else
(void)thread;
return 0;
#endif
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment