Skip to content

Instantly share code, notes, and snippets.

@saethlin
Last active December 6, 2017 00:09
Show Gist options
  • Save saethlin/b79249e36a4bb7f2b796afc3a7c7d5b5 to your computer and use it in GitHub Desktop.
Save saethlin/b79249e36a4bb7f2b796afc3a7c7d5b5 to your computer and use it in GitHub Desktop.
termbox bug?
//! ```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