Fix extra callbacks sent when the timer expires
Several extra callbacks are sent after the first timer expiration
notification. This occurs because data from the FileDescriptor
must be read after the timer expires. Otherwise, expiration
callbacks will continue to be sent, notifying of unread data.
This change also adds TFD_NONBLOCK to timerfd creation to ensure
reading safety.
Test: Manually verify that the callback is sent only once
Change-Id: I30559ed93d0a742b98a58d33d83723f7a155fbd9
2 files changed