mirror of
https://github.com/PacktPublishing/Rust-High-Performance.git
synced 2026-01-25 02:34:19 +09:00
14 lines
275 B
Rust
14 lines
275 B
Rust
use std::thread;
|
|
|
|
fn main() {
|
|
println!("Before the thread!");
|
|
|
|
let handle = thread::spawn(|| {
|
|
println!("Inside the thread!");
|
|
});
|
|
println!("After thread spawn!");
|
|
|
|
handle.join().expect("the thread panicked");
|
|
println!("After everything!");
|
|
}
|