Skip to content
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

fix: 在插入新的timer时,边界条件判断不正确的问题 #1091

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ cppcheck.xml
/target/
Cargo.lock
.cache
compile_commands.json
compile_commands.json
/logs/
2 changes: 1 addition & 1 deletion kernel/src/time/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Timer {
let expire_jiffies = inner_guard.expire_jiffies;
let self_arc = inner_guard.self_ref.upgrade().unwrap();
drop(inner_guard);
let mut split_pos: usize = 0;
let mut split_pos: usize = timer_list.len();
for (pos, elt) in timer_list.iter().enumerate() {
if Arc::ptr_eq(&self_arc, &elt.1) {
warn!("Timer already in list");
Expand Down