Skip to content

Commit

Permalink
simplify demo
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Jan 12, 2025
1 parent dc7015b commit 6621b8a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ extern "C" fn foo() {
let mut s: String = Default::default();
let mut file = File::open("/bin/bla.txt").expect("Unable to create file");
file.read_to_string(&mut s).expect("Unable to read file");
println!("Task {} read file: {}", scheduler::get_current_taskid(), s);

println!("Task {} read {}", scheduler::get_current_taskid(), s);
drop(file);
}

Expand All @@ -74,11 +73,6 @@ pub extern "C" fn main() -> i32 {
.expect("Unable to write data");
drop(file);

let mut s: String = Default::default();
let mut file = File::open("/bin/bla.txt").expect("Unable to create file");
file.read_to_string(&mut s).expect("Unable to read file");
println!("Read file: {}", s);

for _i in 0..2 {
scheduler::spawn(foo, NORMAL_PRIORITY).unwrap();
}
Expand Down

0 comments on commit 6621b8a

Please sign in to comment.