Skip to content

Commit 73397e8

Browse files
committed
task: Call set_oneshot_timer explicitly without scopeguard
1 parent 6d7f97c commit 73397e8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ include-transformed = { version = "0.2", optional = true }
8080
linked_list_allocator = { version = "0.10", default-features = false }
8181
log = { version = "0.4", default-features = false }
8282
pci-ids = { version = "0.2", optional = true }
83-
scopeguard = { version = "1.1", default-features = false }
8483
shell-words = { version = "1.1", default-features = false }
8584
qemu-exit = "3.0"
8685
rand_chacha = { version = "0.3", default-features = false }

src/scheduler/task.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ impl BlockedTaskQueue {
621621
// Shall the task automatically be woken up after a certain time?
622622
if let Some(wt) = wakeup_time {
623623
let mut cursor = self.list.cursor_front_mut();
624-
let _guard = scopeguard::guard((), |_| {
624+
let set_oneshot_timer = || {
625625
#[cfg(not(feature = "tcp"))]
626626
arch::set_oneshot_timer(wakeup_time);
627627
#[cfg(feature = "tcp")]
@@ -635,18 +635,21 @@ impl BlockedTaskQueue {
635635
}
636636
_ => arch::set_oneshot_timer(wakeup_time),
637637
}
638-
});
638+
};
639639

640640
while let Some(node) = cursor.current() {
641641
let node_wakeup_time = node.wakeup_time;
642642
if node_wakeup_time.is_none() || wt < node_wakeup_time.unwrap() {
643643
cursor.insert_before(new_node);
644644

645+
set_oneshot_timer();
645646
return;
646647
}
647648

648649
cursor.move_next();
649650
}
651+
652+
set_oneshot_timer();
650653
}
651654

652655
self.list.push_back(new_node);

0 commit comments

Comments
 (0)