wangchdo commented on PR #17573:
URL: https://github.com/apache/nuttx/pull/17573#issuecomment-3680118470

   > > Thank you @wangchdo amazing work and perfect reporting! :-)
   > > I have one issue, as there is a rename of very old and important file 
and functions inside (`sched/sched/sched_processtimer.c → 
sched/sched/sched_processtick.c`) this seems to be a breaking change, thus both 
PR and related git commit topic should contain `!` as the first character, plus 
description body should contain `BREAKING CHANGE: description on how API is 
changed plus quick fix instructions`. Maybe such invasive change is not really 
necessary? This will help existing users of that API to clearly notice a change 
and adapt their code. Thanks! :-)
   > 
   > Hi @cederom
   > 
   > Thanks for your comments. However, I believe this change is not invasive. 
Let me explain the rationale in more detail.
   > 
   > The original `sched_processtimer()` function in 
`sched/sched/sched_processtimer.c` has been moved into a newly added file 
`sched/sched/sched_timer.c` , while keeping the function prototype and behavior 
fully backward compatible.
   > 
   > The motivation for this refactoring is to introduce a clear separation 
between timer source selection and OS tick processing. All of the original 
logic in `sched_processtimer()` is preserved in a new internal function,` 
sched_processtick()`, located in `sched/sched/sched_processtick.c.` This 
function focuses solely on processing OS ticks and contains the same logic as 
before.
   > 
   > The new`sched_processtimer()`now acts as a thin wrapper around 
`sched_processtick()`, handling only the differences in how OS ticks are 
driven—either by a hardware timer directly or by an hrtimer instance.
   > 
   > As a result:
   > 
   > * When hrtimer is not enabled, the new `sched_processtimer() `behaves 
exactly the same as before, simply delegating to `sched_processtick()`.
   > * When hrtimer is enabled, `sched_processtimer()` creates and uses an 
hrtimer instance to drive `sched_processtick()`.
   > 
   > In essence, no existing behavior is changed. This change merely introduces 
a clearer separation of responsibilities: timer source selection versus OS tick 
processing. All original functionality remains intact and behaves exactly as 
before, with the only addition being an internal `sched_processtick() ` 
function dedicated to OS tick processing, which was already the sole 
responsibility of `sched_processtimer()` previously.
   
   @cederom  I uploaded a amend to this PR to keep the sched_processtimer.c 
file name, and added ! in the commit message, I hope this can eliminate 
confusion 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to