kernel/timeout: Prepare unification of timeout/thread wait_q fields

The existing timeout API wants to store a wait_q on which the thread
is waiting, but it only uses that value in one spot (and there only as
a boolean flag indicating "this thread is waiting on a wait_q).

As it happens threads can already store their own backpointers to a
wait_q (needed for the SCALABLE scheduler backend), so we should use
that instead.

This patch doesn't actually perform that unification yet.  It
reorgnizes things such that the pended_on field is always set at the
point of timeout interaction, and adds a bunch of asserts to make 100%
sure the logic is correct.  The next patch will modify the API.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-09-26 13:19:31 -07:00 committed by Anas Nashif
commit 15d520819d
3 changed files with 8 additions and 16 deletions

View file

@ -393,12 +393,10 @@ struct _thread_base {
struct rbnode qnode_rb;
};
#ifdef CONFIG_WAITQ_SCALABLE
/* wait queue on which the thread is pended (needed only for
* trees, not dumb lists)
*/
_wait_q_t *pended_on;
#endif
/* user facing 'thread options'; values defined in include/kernel.h */
u8_t user_options;