Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::{sync::{ Arc, Mutex}, thread };
- fn main() {
- let v = vec![1, 2, 3, 4];
- let _data = Arc::new(Mutex::new(v));
- for t in 0..10 {
- thread::spawn(move|| {
- dbg!(t);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement