-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
In the following example, "Hello, world!" is printed after ten seconds, rather than 200ms.
fn main() {
let cores = std::thread::available_parallelism().unwrap().get();
for _ in 0..cores {
std::thread::spawn(|| {
std::thread::sleep(Duration::from_secs(10));
});
}
std::thread::sleep(Duration::from_millis(200));
println!("Hello, world!");
}
I believe this is because the oneshot timer is overwritten unconditionally in src/scheduler/task/mod.rs:
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();
Metadata
Metadata
Assignees
Labels
No labels