kernel/poll: Store the work queue in the triggered work poll items

The poll code was playing this weird trick where the thread pointer in
the "struct _poller" object for a triggered work item.  It would not
be a thread to wake up, but instead a pointer to the (non-polling)
thread operated by the work queue being triggered.  The code would
never touch this thread, just use it as a way to get a pointer to the
enclosing work queue struct.

Just store the work queue pointer in the first place.  It's much
simpler, and makes future modifications to remove that thread pointer
possible.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2020-11-09 10:43:25 -08:00 committed by Anas Nashif
commit 310f60f5b6
2 changed files with 15 additions and 22 deletions

View file

@ -2765,8 +2765,8 @@ struct k_delayed_work {
struct k_work_poll {
struct k_work work;
struct k_work_q *workq;
struct _poller poller;
struct k_thread *thread;
struct k_poll_event *events;
int num_events;
k_work_handler_t real_handler;