wangchdo opened a new pull request, #17222:
URL: https://github.com/apache/nuttx/pull/17222
This PR includes three commits:
**commit 1:**
In the current scheduler implementation, nxsched_ticksleep()
sets the current task state to TSTATE_WAIT_SIG, which is not
semantically appropriate. A dedicated TSTATE_SLEEPING state
is more suitable for this purpose.
Additionally, list_sleepingtasks() is introduced to replace
list_waitingforsignal() in the nxsched_ticksleep() implementation,
to clearly distinguish tasks sleeping for timeout from those
waiting for signals.
**commit 2:**
Add a new function nxsched_wakeup() to the scheduler,
which allows waking up a sleeping task before its timeout.
**commit 3:**
Refactor nxsched_timeout() to use nxsched_wakeup() in order to
eliminate code duplication and improve maintainability
## Summary
Improved implementation of nxsched_ticksleep() and introduced new function
nxsched_wakeup()
## Impact
Improvement of newly added function nxsched_ticksleep() and introduced a
new function nxsched_wakeup()
No impact to other nuttx functions
## Testing
[PR 17204 ](https://github.com/apache/nuttx/pull/17204) has already replace
all Signal-based sleep implement to Scheduled sleep, So CI will verify this
PR's improvement of nxsched_ticksleep() is OK
--
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]