general: Name spawned threads
This is for easier debugging in case a panic happens - instead of dealing with "thread <unnamed> paniced...", etc., we get a name relevant to our context.
This commit is contained in:
parent
d99215bfd1
commit
37f170b165
2 changed files with 12 additions and 8 deletions
|
|
@ -377,10 +377,12 @@ impl LpPropertiesView {
|
|||
async fn parse_svg_file_future(path: std::path::PathBuf) -> anyhow::Result<svg_metadata::Metadata> {
|
||||
let (sender, receiver) = futures_channel::oneshot::channel();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
let result = svg_metadata::Metadata::parse_file(path);
|
||||
let _ = sender.send(result);
|
||||
});
|
||||
let _ = std::thread::Builder::new()
|
||||
.name("Parse SVG".to_string())
|
||||
.spawn(move || {
|
||||
let result = svg_metadata::Metadata::parse_file(path);
|
||||
let _ = sender.send(result);
|
||||
});
|
||||
|
||||
receiver.await.unwrap().context("Could not load metadata")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue