diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index 6f19f4a..6857205 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -912,9 +912,12 @@ impl Stream { let (tx, rx) = trigger(); // Clone the handle for passing into worker thread. let stream = inner.clone(); - let thread = thread::spawn(move || { - input_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback); - }); + let thread = thread::Builder::new() + .name("cpal_alsa_in".to_owned()) + .spawn(move || { + input_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback); + }) + .unwrap(); Stream { thread: Some(thread), inner, @@ -934,9 +937,12 @@ impl Stream { let (tx, rx) = trigger(); // Clone the handle for passing into worker thread. let stream = inner.clone(); - let thread = thread::spawn(move || { - output_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback); - }); + let thread = thread::Builder::new() + .name("cpal_alsa_out".to_owned()) + .spawn(move || { + output_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback); + }) + .unwrap(); Stream { thread: Some(thread), inner, diff --git a/src/host/wasapi/stream.rs b/src/host/wasapi/stream.rs index a72f244..d037fa2 100644 --- a/src/host/wasapi/stream.rs +++ b/src/host/wasapi/stream.rs @@ -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),