Skip to content
Snippets Groups Projects
Commit 73397e87 authored by Martin Kröning's avatar Martin Kröning :crab:
Browse files

task: Call set_oneshot_timer explicitly without scopeguard

parent 6d7f97cb
Branches rm-dependencies
Tags
No related merge requests found
Pipeline #904372 passed
......@@ -245,7 +245,6 @@ dependencies = [
"pci-ids",
"qemu-exit",
"rand_chacha",
"scopeguard",
"shell-words",
"smoltcp",
"time",
......
......@@ -80,7 +80,6 @@ include-transformed = { version = "0.2", optional = true }
linked_list_allocator = { version = "0.10", default-features = false }
log = { version = "0.4", default-features = false }
pci-ids = { version = "0.2", optional = true }
scopeguard = { version = "1.1", default-features = false }
shell-words = { version = "1.1", default-features = false }
qemu-exit = "3.0"
rand_chacha = { version = "0.3", default-features = false }
......
......@@ -621,7 +621,7 @@ impl BlockedTaskQueue {
// Shall the task automatically be woken up after a certain time?
if let Some(wt) = wakeup_time {
let mut cursor = self.list.cursor_front_mut();
let _guard = scopeguard::guard((), |_| {
let set_oneshot_timer = || {
#[cfg(not(feature = "tcp"))]
arch::set_oneshot_timer(wakeup_time);
#[cfg(feature = "tcp")]
......@@ -635,18 +635,21 @@ impl BlockedTaskQueue {
}
_ => arch::set_oneshot_timer(wakeup_time),
}
});
};
while let Some(node) = cursor.current() {
let node_wakeup_time = node.wakeup_time;
if node_wakeup_time.is_none() || wt < node_wakeup_time.unwrap() {
cursor.insert_before(new_node);
set_oneshot_timer();
return;
}
cursor.move_next();
}
set_oneshot_timer();
}
self.list.push_back(new_node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment