Skip to content
Commit 5e7ef3d7 authored by Manuel Stoeckl's avatar Manuel Stoeckl Committed by Héctor Orón Martínez
Browse files

event-loop-test: Verify proper timer cancellation



The implementation of timer event sources based on timerfds ensured
specific edge-case behavior with regards to removing and updating timers:

Calls to `wl_event_loop_dispatch` will dispatch all timer event sources
that have expired up to that point, with one exception. When multiple
timer event sources are due to be dispatched in a single call of
`wl_event_loop_dispatch`, calling wl_event_source_remove` from within a
timer event source callback will prevent the removed event source's
callback from being called. Note that disarming or updating one of the
later timers that is due to be dispatched, from within a timer callback,
will NOT prevent that timer's callback from being invoked by
`wl_event_loop_dispatch`.

This commit adds a test that verifies the above behavior. (Because
epoll_wait is not documented to return timerfds in chronological order,
(although it does, in practice), the test code does not depend on the
order in which timers are dispatched.)

Signed-off-by: default avatarManuel Stoeckl <code@mstoeckl.com>
parent 88e96735
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment