Last active
December 6, 2017 00:09
-
-
Save saethlin/b79249e36a4bb7f2b796afc3a7c7d5b5 to your computer and use it in GitHub Desktop.
termbox bug?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! ```cargo | |
//! [dependencies] | |
//! termbox_simple = "0.2.0" | |
//! ``` | |
extern crate termbox_simple; | |
use termbox_simple::Termbox; | |
use std::sync::{Arc, Mutex}; | |
use std::thread; | |
// We need to new_server_tab before attempting to draw, or the program instantly exits | |
fn main() { | |
let handle = Arc::new(Mutex::new(Termbox::init().unwrap())); | |
let moved_handle = handle.clone(); | |
thread::spawn(move || { | |
// Do something with the handle | |
moved_handle.lock().unwrap().clear(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment