Thread panicked in redox
Created by: sinkarharshad
Reproduction: Created two threads in rust, compiled and works fine. Then I moved my code to redox recipes. I compiled redox successfully. But unfortunately not able to run threads in redox shell.
My Code: main.rs
fn main (){
use std::thread;
let child = thread::spawn(move || {
for x in 0..5{
println!("Hello from Child");
}
});
let parent = thread::spawn(move || {
for x in 0..5{
println!("Hello from Parent");
}
});
let res = child.join();
}
Expected behavior: Output which I should get:
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/threadsinrust`
Hello from Child
Hello from Child
Hello from Child
Hello from Child
Hello from Child
Hello from Parent
Hello from Parent
Hello from Parent
Hello from Parent
Hello from Parent
Actual behavior: Output which I am getting in redox's shell:
user:file:/home/user# threadsinrust
Hello from Child
Hello from Child
Hello from Child
Hello from Child
Hello from Child
Hello from Parent
thread '<unnamed>' panicked at 'cannot access stdout during shutdown', /home/shk4abt/devel/redoxos/redox/rust/src/libcore/option.rs:819:4
What m I doing wrong here? Thank you in advance.