give each thread a unique name

This commit is contained in:
Marcel Märtens 2021-03-22 11:06:15 +01:00
parent f9720b9767
commit a945d83ac7
2 changed files with 20 additions and 10 deletions

View file

@ -100,8 +100,10 @@ impl Stream {
commands: rx,
};
let thread =
thread::spawn(move || run_input(run_context, &mut data_callback, &mut error_callback));
let thread = thread::Builder::new()
.name("cpal_wasapi_in".to_owned())
.spawn(move || run_input(run_context, &mut data_callback, &mut error_callback))
.unwrap();
Stream {
thread: Some(thread),
@ -129,8 +131,10 @@ impl Stream {
commands: rx,
};
let thread =
thread::spawn(move || run_output(run_context, &mut data_callback, &mut error_callback));
let thread = thread::Builder::new()
.name("cpal_wasapi_out".to_owned())
.spawn(move || run_output(run_context, &mut data_callback, &mut error_callback))
.unwrap();
Stream {
thread: Some(thread),