-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct/clarify TimerEvent::insert documentation #14005
Conversation
@kjbracey-arm, thank you for your changes. |
There was much confusion over the functionality of the original `TimerEvent::insert` call which was described as "Set relative timestamp of the internal event". This then extended to my Chrono conversion, meaning the new `insert` call is not equivalent. Clarify the original documentation, correct the deprecation messages, and add more notes on conversion. No functional change, as the new Chrono API makes more sense - it's just different from the old API. Problem actually spotted when I saw the strange code `convert_timestamp` was producing for the 32-bit->64-bit timestamp conversion. The caller of it was actually making the mistake of issuing "TimerEvent::insert(rel_timeout)`, meaning they'd also misunderstood the documentation, and were not getting the timeout they expected. (Chrono would have prevented that mistake as durations and time points are incompatible types).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the documentation update. I confirm that insert_absolute()
was added as an equivalent to insert()
to support 64-bit timestamp, see #4094, so both are absolute. I guess "relative" (in that PR) initially meant relative to the current 32-bit cycle, instead of relative to the current time.
It feels to me the non-chrono insert()
would've required a proper fix to align with the chrono one, if it weren't deprecated. But as we don't want behaviour changes on something deprecated, this change looks good.
Thanks for finding the history! Even if the old |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
There was much confusion over the functionality of the original
TimerEvent::insert
call which was described as "Set relative timestamp of the internal event".This then extended to my Chrono conversion, meaning the new
insert
call is not equivalent - it really is relative.Clarify the original documentation, correct the deprecation messages, and add more notes on conversion.
No functional change, as the new Chrono API makes more sense - it's just different from the old API.
Problem actually spotted when I saw the strange code
convert_timestamp
was producing for the 32-bit->64-bit timestamp conversion. The caller of it was actually making the mistake of issuingTimerEvent::insert(rel_timeout)
, meaning they'd also misunderstood the documentation, and were not getting the timeout they expected.(Chrono would have prevented that mistake as durations and time points are incompatible types).
Impact of changes
Probably not worth putting anything specific in release notes - the
insert
call was already deprecated (probably should have been double deprecated, given the 64-bit API). Anyone actually using it must have already spotted the issue during conversion. I don't thinkTimerEvent
is used much by apps directly - it's a building block forTimeout
andTicker
, which are more commonly used.Migration actions required
Documentation
None
Pull request type
Test results
Reviewers