Skip to content
Commit 71f5e565 authored by Andy Ross's avatar Andy Ross Committed by Anas Nashif
Browse files

kernel/timeout: Fix "not in list" predication in timeout handling



The use of dticks == INACTIVE to tell whether or not a timeout was
already in the list was insufficient.  There is a time period between
the moment a timeout is removed from the list and the end of its
handler where it is not in the list, yet its list node pointers still
point into it.  Doing things like aborting a thread while that is true
(which can be asynchronous too!)  would corrupt the list even though
all the operations on it were "atomic".

Set the timeout node pointers to nulls atomically when removed, and
check for double-remove conditions (which, again, might be perfectly
OK).

Signed-off-by: default avatarAndy Ross <andrew.j.ross@intel.com>
parent 43ab8da9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment