Merge pull request #919 from jwilm/name-dns-threads

Spawn client DNS threads with descriptive name
This commit is contained in:
Sean McArthur
2016-10-01 14:49:00 -07:00
committed by GitHub

View File

@@ -48,7 +48,7 @@ impl Dns {
}
fn work(rx: spmc::Receiver<String>, notify: channel::Sender<Answer>) {
thread::spawn(move || {
thread::Builder::new().name(String::from("hyper-dns")).spawn(move || {
let mut worker = Worker::new(rx, notify);
let rx = worker.rx.as_ref().expect("Worker lost rx");
let notify = worker.notify.as_ref().expect("Worker lost notify");
@@ -64,7 +64,7 @@ fn work(rx: spmc::Receiver<String>, notify: channel::Sender<Answer>) {
}
}
worker.shutdown = true;
});
}).expect("spawn dns thread");
}
struct Worker {