From df1b4c1973830a8638c9ff8ff858cfe2fe3a1655 Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Mon, 29 Feb 2016 10:42:53 +0100 Subject: [PATCH] Run client in main thread. --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 24a2080..db0bee0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,13 +53,11 @@ fn main() { let mut client = Client::new( client_rx, client_to_handler_tx, client_to_control_tx); - thread::spawn(move || client.run()); let mut controller = Controller::new(client_tx, client_to_control_rx); - thread::spawn(move || { - controller.run(); - }); - event_loop.run(&mut handler).unwrap(); + thread::spawn(move || controller.run()); + thread::spawn(move || event_loop.run(&mut handler).unwrap()); + client.run(); }