From be09467d48a5b7644411c2a09d948ee89509894e Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Fri, 23 Sep 2016 10:12:11 -0700 Subject: Fix some compiler warnings Also enables debug symbols in release profile by default. Until Alacritty ships, there's going to be lots of perf analysis which needs debug symbols. The PriorityMutex low priority method was never used. Now it's just a fair mutex. --- src/main.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0b72c374..e520b08d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,12 +56,12 @@ mod sync; use std::sync::{mpsc, Arc}; use std::sync::atomic::{AtomicBool, Ordering}; -use parking_lot::{Condvar, Mutex, MutexGuard}; +use parking_lot::{MutexGuard}; use config::Config; use meter::Meter; use renderer::{QuadRenderer, GlyphCache}; -use sync::PriorityMutex; +use sync::FairMutex; use term::Term; use tty::process_should_exit; use util::thread; @@ -183,7 +183,7 @@ fn main() { let signal_flag = Flag::new(false); - let terminal = Arc::new(PriorityMutex::new(terminal)); + let terminal = Arc::new(FairMutex::new(terminal)); let window = Arc::new(window); let pty_reader = PtyReader::spawn( @@ -196,7 +196,6 @@ fn main() { // Wraps a renderer and gives simple draw() api. let mut display = Display::new( window.clone(), - terminal.clone(), renderer, glyph_cache, render_timer, @@ -212,7 +211,7 @@ fn main() { processor.process_events(&window); // Maybe draw the terminal - let terminal = terminal.lock_high(); + let terminal = terminal.lock(); signal_flag.set(false); if terminal.dirty { display.draw(terminal); @@ -231,7 +230,7 @@ fn main() { struct PtyReader; impl PtyReader { - pub fn spawn(terminal: Arc>, + pub fn spawn(terminal: Arc>, mut pty: R, proxy: ::glutin::WindowProxy, signal_flag: Flag) @@ -244,7 +243,7 @@ impl PtyReader { loop { if let Ok(got) = pty.read(&mut buf[..]) { - let mut terminal = terminal.lock_high(); + let mut terminal = terminal.lock(); for byte in &buf[..got] { pty_parser.advance(&mut *terminal, *byte); @@ -271,7 +270,6 @@ impl PtyReader { struct Display { window: Arc, - terminal_mutex: Arc>, renderer: QuadRenderer, glyph_cache: GlyphCache, render_timer: bool, @@ -281,7 +279,6 @@ struct Display { impl Display { pub fn new(window: Arc, - terminal_mutex: Arc>, renderer: QuadRenderer, glyph_cache: GlyphCache, render_timer: bool, @@ -290,7 +287,6 @@ impl Display { { Display { window: window, - terminal_mutex: terminal_mutex, renderer: renderer, glyph_cache: glyph_cache, render_timer: render_timer, -- cgit