-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[kernel][src] reload timeout_tick with absolute base value #5402
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
need_schedule 标记是防止 A 定时器回调中 sleep 等操作导致线程挂起。B 定时器启动时,意外将 timer 线程唤醒。导致 A 定时器意外唤醒
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.
need_schedule 这个变量的作用不是你说那样,跟你说的那个没联系,rt_timer_start 最后有两种情况,一种是需要进行任务调度切换到 timer 线程,一种是不需要。
需要任务调度的流程是: 开中断;调用
rt_schedule
;return
返回。不需要任务调度的流程是: 开中断;
return
返回。之前就是把上述两种流程合并到一起,用
need_schedule
变量控制中间rt_schedule
是否被执行的开关。这样的用法在多处有 return 返回的情况下使用比较合适,但是这里只在函数最后紧挨着的地方有两个返回点,分开写代码语义比较清晰。你可能想说的是
_soft_timer_status
这个变量,用来限制“某些”情况下任务调度,关于这个 pr 的详细说明,请移步论坛,那里有更全面的理论分析。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.
能否贴一下论坛链接?
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.
_soft_timer_status
变量去掉后,timer 线程被异常唤醒的问题,这个问题是咋解决的?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.
是的,这问题是怎么解决的?