From d39b2d6e511ff90c3c4d7814ed966d1fabf1c4d0 Mon Sep 17 00:00:00 2001 From: Robert Hedman <robert.hedman@mac.com> Date: Sun, 19 Nov 2017 21:52:57 +0100 Subject: [PATCH] sync --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9572414..c7a91fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,12 @@ use std::thread; use std::sync::mpsc; -const FILE_SIZE: usize = 100*50; +const ROWS: usize = 50; +const COLS: usize = 100; fn main() { + let map = [[0u32; ROWS]; COLS]; + let (requestLocationTX, requestLocationRX): (mpsc::Sender<bool>, mpsc::Receiver<bool>) = mpsc::channel(); let (sendLocationTX, sendLocationRX): (mpsc::Sender<(i32, i32)>, mpsc::Receiver<(i32, i32)>) = mpsc::channel(); @@ -28,6 +31,7 @@ fn main() { }, Err(e) => { //println!("Error: {}, on recieving side.", e); + //thread::sleep_ms(100); }, }; }; @@ -48,7 +52,7 @@ fn main() { // update map - if pos.0 == 10000 { + if pos.0 == 100 { println!("mapper done."); requestLocationTX.send(false).unwrap(); break; @@ -60,8 +64,8 @@ fn main() { }); println!("Main wating for join."); - mapper.join(); - tracker.join(); + mapper.join().unwrap(); + tracker.join().unwrap(); println!("end of main"); // pathfinder, takes a map and returns a list of nodes to aim for when driving -- GitLab