shared/timeout-ell: Fix timeout wrapper implementation
authorInga Stotland <inga.stotland@intel.com>
Mon, 5 Oct 2020 04:19:32 +0000 (21:19 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:33 +0000 (19:08 +0530)
commit9b47e87f99a38339bc86c9dde34f743c8d8f2dcd
treedc4456ed7e81529dad7f72eae6c3ac5d94a1b78f
parent0f6673d87e7e7b0f0b1a7489817d4bc4499f693a
shared/timeout-ell: Fix timeout wrapper implementation

This fixes the following issues:
- Correct user data is passed around to l_timeout_create():
  locally allocated timeout data is a valid "user data" to
  associate with a newly created timeout. Previously, user_data
  passed as an argument to timeout_add() was incorrectly used as
  an argument to l_timeout_create()
- To maintain common API and work around the issue when the conversion
  of a pointer to an unsigned int truncates the initial value, a queue
  of active timeouts is maintained where pointer each l_timeout structure
  is associate with a unique id. This id is returned when timeout_create()
  API is called and can be subsequently used with timeout_remove().

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/timeout-ell.c