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

kernel/timeout: Refactor z_clock_announce() loop



This loop was structured badly, as a while(true) with multiple "exit
if" cases in the body.  It was bad enough that I genuinely fooled
myself into rewriting it, having convinced myself there was a bug in
it when there wasn't.

So keep the rewritten loop which expresses the iteration in a more
invariant way (i.e. "while we have an element to expire" and not "test
if we have to exit the loop").  Shorter and easier.  Also makes the
locking clearer as we can simply release the lock around the callback
in a natural/obvious way.

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