sched/sleep: Add nxsched_nanosleep() API#17368
Merged
Merged
Conversation
3e83236 to
e312992
Compare
This was referenced Nov 24, 2025
e312992 to
9fce966
Compare
Introduce the nxched_nanosleep() API to provide a lightweight nanosecond-level sleep based on nxsched_ticksleep(). This API offers the same functionality as nxsig_nanosleep() but without signal-related overhead, making it suitable for implementing libc sleep() or usleep() when signals are disabled. Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
9fce966 to
e5cd5f6
Compare
xiaoxiang781216
approved these changes
Nov 24, 2025
jerpelea
approved these changes
Nov 24, 2025
Lenoids
added a commit
to Lenoids/nuttx
that referenced
this pull request
Dec 3, 2025
As pull request apache#17200 & apache#17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces. This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()). Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
Lenoids
added a commit
to Lenoids/nuttx
that referenced
this pull request
Dec 3, 2025
As pull request apache#17200 & apache#17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces. This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()). Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
Lenoids
added a commit
to Lenoids/nuttx
that referenced
this pull request
Dec 3, 2025
As pull request apache#17200 & apache#17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces. This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()). Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
Lenoids
added a commit
to Lenoids/nuttx
that referenced
this pull request
Dec 3, 2025
As pull request apache#17200 & apache#17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces. This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()). Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
Lenoids
added a commit
to Lenoids/nuttx
that referenced
this pull request
Dec 4, 2025
As pull request apache#17200 & apache#17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces. This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()). Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
simbit18
pushed a commit
that referenced
this pull request
Dec 4, 2025
As pull request #17200 & #17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces. This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()). Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce the nxsched_nanosleep() API to provide a lightweight nanosecond-level sleep based on nxsched_ticksleep(). This API offers the same functionality as nxsig_nanosleep() but without signal-related overhead, making it suitable for implementing libc sleep() or usleep() when signals are disabled.
Impact
New api added, no impact to existing nuttx functions
Testing
ostest passed on board fvp-armv8r-aarch32