Skip to content

Commit

Permalink
Merge pull request #919 from jwilm/name-dns-threads
Browse files Browse the repository at this point in the history
Spawn client DNS threads with descriptive name
  • Loading branch information
seanmonstar authored Oct 1, 2016
2 parents a6064a6 + b4c6508 commit f9f13ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -64,7 +64,7 @@ fn work(rx: spmc::Receiver<String>, notify: channel::Sender<Answer>) {
}
}
worker.shutdown = true;
});
}).expect("spawn dns thread");
}

struct Worker {
Expand Down

0 comments on commit f9f13ea

Please sign in to comment.