1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core: provide function to check msg queue initialization

This makes it easier to refactor that part of the `thread_t` structure
later on.
This commit is contained in:
Martine Lenders 2018-11-15 13:53:27 +01:00 committed by Martine Lenders
parent a98edd33a0
commit 7835db5ec3

View File

@ -527,6 +527,26 @@ void thread_stack_print(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
}
#endif