unified: Ensure K_THREAD_DEFINE() generates a thread id

Previously the macro provided no way for an application to
easily reference a statically-defined thread.

Change-Id: I552e5f4ab4e6e8a793bb3a6a2b0c2636b900023a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2016-10-26 14:15:08 -05:00
commit 88095027f4

View file

@ -196,7 +196,8 @@ struct _static_thread_data {
__in_section(_k_task_list, private, task) = \
_THREAD_INITIALIZER(_k_thread_obj_##name, stack_size, \
entry, p1, p2, p3, prio, options, delay, \
NULL, 0)
NULL, 0); \
const k_tid_t name = (k_tid_t)_k_thread_obj_##name
extern int k_thread_priority_get(k_tid_t thread);
extern void k_thread_priority_set(k_tid_t thread, int prio);