use std::thread; fn main() { let handle = thread::spawn(|| { println!("Hello from thread"); }); handle.join().unwrap(); println!("Main done"); }
Output
Click Run to execute, or Check to validate.
Ask questions or share tips about this tutorial
Sign in to join the discussion