alacritty/src/util.rs

13 lines
413 B
Rust
Raw Normal View History

2016-06-08 04:11:23 +00:00
/// Threading utilities
pub mod thread {
/// Like `thread::spawn`, but with a `name` argument
pub fn spawn_named<F, T, S>(name: S, f: F) -> ::std::thread::JoinHandle<T>
where F: FnOnce() -> T,
F: Send + 'static,
T: Send + 'static,
S: Into<String>
{
::std::thread::Builder::new().name(name.into()).spawn(f).expect("thread spawn works")
}
}