mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 14:16:47 +00:00
fix: 在插入新的timer时,边界条件判断不正确的问题 (#1091)
修复split_pos 初始值错误导致原本应该被插入到链表末尾的定时器,插入到了链表头 Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
parent
3364e0424f
commit
5644e716e1
3
.gitignore
vendored
3
.gitignore
vendored
@ -18,4 +18,5 @@ cppcheck.xml
|
||||
/target/
|
||||
Cargo.lock
|
||||
.cache
|
||||
compile_commands.json
|
||||
compile_commands.json
|
||||
/logs/
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user